Skip to content

'dotnet run file.cs' tries/fails to find the ILCompiler for the non-portable rid. #52395

@tmds

Description

@tmds
#:package Newtonsoft.Json@*

Console.WriteLine("Hello World");

Running the previous with a source-built .NET 10 SDK gives:

$ dotnet run example.cs 
/tmp/repro/example.csproj : error NU1101: Unable to find package runtime.fedora.42-x64.Microsoft.DotNet.ILCompiler. No packages exist with this id in source(s): /usr/lib64/dotnet/library-packs, nuget.org

The build failed. Fix the build errors and run again.

I'm not sure why this command goes look for the ILCompiler? Is it needed?

A Microsoft.DotNet.ILCompiler for fedora.42-x64 is available, but only if the user installs the dotnet-sdk-aot-10.0 package.

For other commands, the SDK will only use it when the user explicitly sets the RuntimeIdentifier to the non-portable rid. So here as well it would be preferable to use the NETCoreSdkPortableRuntimeIdentifier (instead of NETCoreSdkRuntimeIdentifier).

cc @baronfel @dsplaisted @dotnet/source-build @omajid

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-NativeAOTNative AOT compilationArea-run-fileItems related to the "dotnet run <file>" effort

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions