Skip to content

multi-RID tools that are framework-dependent do not work #49494

@baronfel

Description

@baronfel

Describe the bug

We can create RID-specific, FDD tools easily now, but when those tools are executed (at least on Windows), they do not run.

To Reproduce

Clone https://github.com/baronfel/multi-rid-tool and run the following commands:

>dotnet pack -p ToolType=specific
Restore complete (5.5s)
You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
  toolsay net10.0 succeeded (0.1s) → artifacts\publish\toolsay\release\
  toolsay net10.0 succeeded (0.2s) → artifacts\publish\toolsay\release_linux-x64\
  toolsay net10.0 succeeded (0.1s) → artifacts\publish\toolsay\release_win-arm64\
  toolsay net10.0 succeeded (0.1s) → artifacts\publish\toolsay\release_win-x64\
  toolsay succeeded (0.5s) → artifacts\bin\toolsay\release_linux-x64\toolsay.dll
  toolsay net10.0 succeeded (0.2s) → artifacts\publish\toolsay\release_linux-arm64\
  toolsay net10.0 succeeded (0.2s) → artifacts\publish\toolsay\release_osx-arm64\                                                                 
  toolsay succeeded (0.7s) → artifacts\bin\toolsay\release_win-arm64\toolsay.dll
  toolsay succeeded (0.7s) → artifacts\bin\toolsay\release_win-x64\toolsay.dll
  toolsay succeeded (0.7s) → artifacts\bin\toolsay\release_osx-arm64\toolsay.dll
  toolsay succeeded (0.7s) → artifacts\bin\toolsay\release_linux-arm64\toolsay.dll
  toolsay succeeded (3.3s) → artifacts\bin\toolsay\release\toolsay.dll

Build succeeded in 10.6s
> dotnet nuget locals global-packages --clear
Clearing NuGet global packages folder: C:\Users\chusk\.nuget\packages\
> dotnet tool exec toolsay --source ./artifacts/package/release  "Hello, World!"
Tool package toolsay@1.0.0 will be downloaded from source E:\Code\samples\multi-rid-tool\artifacts\package\release.
Proceed? [y/n] (y): y
Unhandled exception. System.BadImageFormatException: Bad IL format. The format of the file 'C:\Users\chusk\.nuget\packages\toolsay.win-x64\1.0.0\tools\net10.0\win-x64\toolsay.exe' is invalid.

Exceptions (if any)

Further technical details

  • Include the output of dotnet --info
  • The IDE (VS / VS Code/ VS4Mac) you're running on, and its version

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions