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

NETSDK1206 error when building the aspnetcore repo with latest 8.0 Preview 6 SDK build #33486

Open
mthalman opened this issue Jun 15, 2023 · 8 comments
Assignees
Milestone

Comments

@mthalman
Copy link
Member

The following error occurs when attempting to build the aspnetcore repo with the latest 8.0 Preview 6 SDK build (e.g. 8.0.100-preview.6.23315.8):

/vmr/.dotnet/sdk/8.0.100-preview.6.23315.1/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(267,5): error NETSDK1206: Found version-specific or distribution-specific runtime identifier(s): win. Affected libraries: System.Security.Cryptography.Pkcs. In .NET 8.0 and higher, assets for version-specific and distribution-specific runtime identifiers will not be found by default. See https://aka.ms/dotnet/rid-usage for details. [/vmr/src/aspnetcore/artifacts/source-build/self/src/src/DataProtection/DataProtection/src/Microsoft.AspNetCore.DataProtection.csproj::TargetFramework=net8.0]

This is a new warning check added by #32970.

This was caught by source-build's bootstrapping build workflow which validates the product can build itself using the SDK it produced.

@halter73
Copy link
Member

@elinor-fung This looks like an SDK issue to me. I cannot image that the "win" RID that System.Security.Cryptography.Pkcs is targeting is too specific considering that "win" is listed as one of the "portable RIDs" in https://learn.microsoft.com/en-us/dotnet/core/compatibility/deployment/8.0/rid-asset-list#new-behavior.

@marcpopMSFT marcpopMSFT self-assigned this Jun 26, 2023
@elinor-fung
Copy link
Member

The warning is relying on the list of available RIDs in KnownFrameworkReference/KnownRuntimePack items for Microsoft.NETCore.App. It looks like aspnetcore explicitly updates the KnownFrameworkReference for Microsoft.NETCore.App to only have the target RID in source build:
https://github.com/dotnet/aspnetcore/blob/6dd34f7baefd4995f544b9a3f95ccd3b43acf4d4/eng/tools/GenerateFiles/Directory.Build.targets.in#L63-L64
Resulting in win not being in that list. I don't quite understand what exactly it is for and why it doesn't prepend to the list (like in the product's generated BundledVersions props) - @halter73 would you know?

I expect #33584 will indirectly fix this (won't warn anymore in this scenario), since it will find the win platform in the KnownRuntimePack items that aspnetcore does not modify to only have the target RID.

@lewing
Copy link
Member

lewing commented Jul 13, 2023

hitting this in runtime now that arcade took the sdk bump dotnet/runtime#88827

@elinor-fung
Copy link
Member

elinor-fung commented Jul 13, 2023

The issue dotnet/runtime#88827 is hitting is slightly different. It has no FrameworkReferences at all, since it is building the framework. That would not be addressed after #33584 - I'll look at how to make it handle that case. Filed #34003.

@elinor-fung
Copy link
Member

@mthalman what would be a good way to test this? I believe this should be addressed now. I tried building dotnet/dotnet with the warn_as_error=false removed from aspnetcore.proj, which seemed to work.

@mthalman
Copy link
Member Author

Good to hear. I'll run a test build in CI to verify.

@steveisok
Copy link
Member

I've got this a few times after cleaning and rebuilding runtime on osx. If I clean and rebuild again it seems to go away for a little while.

@MichaCo
Copy link

MichaCo commented Jun 5, 2024

Getting the same warning now for Microsoft.Data.SqlClient 5.x when targeting <TargetFramework>net8.0</TargetFramework>

warning NETSDK1206: Found version-specific or distribution-specific runtime identifier(s): win7-x64, win7-x86. Affected libraries: runtime.win7-x64.runtime.native.System.Data.SqlClient.sni, runtime.win7-x86.runtime.native.System.Data.SqlClient.sni. In .NET 8.0 and higher, assets for version-specific and distribution-specific runtime identifiers will not be found by default. See https://aka.ms/dotnet/rid-usage for details.

Can I simply ignore this or what can I do here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants