Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dotnet restore doesn't respect the <RuntimeIdentifier> for sdk-style project. #40517

Open
dxynnez opened this issue Apr 29, 2024 · 1 comment
Labels
Area-NetSDK untriaged Request triage from a team member

Comments

@dxynnez
Copy link

dxynnez commented Apr 29, 2024

Describe the bug

We are migrating our Azure Functions (isolated mode) to .Net 8 but got following errors when trying to build & publish the app as self-contained:

NETSDK1112: The runtime pack for Microsoft.NETCore.App.Runtime.win-x64 was not downloaded. Try running a NuGet restore with the RuntimeIdentifier 'win-x64'.
NETSDK1112: The runtime pack for Microsoft.AspNetCore.App.Runtime.win-x64 was not downloaded. Try running a NuGet restore with the RuntimeIdentifier 'win-x64'.

It appears that in .Net 8, the dotnet restore would not respect the RID specified in the sdk-style project - we got a similar error when trying to publish a console app in the same way.

To Reproduce

Create an Azure Funtions for .Net 8.0 Isolated using the VS built-in template, Add <RuntimeIdentifier>win-x64</RuntimeIdentifier> into the csproj.

Make sure the 'Microsoft.NETCore.App.Runtime' is not in the local nuget cache.

dotnet restore
dotnet build --configuration release --no-restore --self-contained true
dotnet publish --configuration release --no-restore --no-build --self-contained true

Exceptions (if any)

NETSDK1112: The runtime pack for Microsoft.NETCore.App.Runtime.win-x64 was not downloaded. Try running a NuGet restore with the RuntimeIdentifier 'win-x64'.
NETSDK1112: The runtime pack for Microsoft.AspNetCore.App.Runtime.win-x64 was not downloaded. Try running a NuGet restore with the RuntimeIdentifier 'win-x64'.

Further technical details

  • Include the output of dotnet --info
  • The IDE (VS / VS Code/ VS4Mac) you're running on, and its version
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-NetSDK untriaged Request triage from a team member labels Apr 29, 2024
@dxynnez
Copy link
Author

dxynnez commented May 3, 2024

Hello team, can someone help to take a look at this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-NetSDK untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

1 participant