-
Notifications
You must be signed in to change notification settings - Fork 252
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
Unexpected error “Your project file doesn’t list ‘win’ as a “RuntimeIdentifier”” occurs when building the solution after enabling “RestoreLockedMode” #10590
Comments
@nkolev92 - Would you mind taking a look? |
I'm not confident this we can rely on this as an assumption. If you had actual code in any of your projects, then at build time, you'd get many other other errors telling you that it can't resolve certain types. There's a chance we can avoid this particular message. We create dummy targets. I'll take a look during Quality Week. |
I found this issue while working on a VS feedback ticket with similar error message https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1348331. I followed the repro steps mentioned in the issue description on Dev17 and noticed only 1 error |
SDK based proejcts won't have this |
Is there a workaround for this? Getting this all of a sudden since upgrading to .NET 7 when trying to build an old style .csproj (which used to build fine, and is building fine on build server which doesn't have .NET 7 or related tools)
Edit: Updating my Visual Studio 22 to latest version, restart + loading the project has fixed it (and it asked to download .NET Desktop Development tools) |
Clean the project (delete obj and bin directory) and build it again. |
This could happen in case you upgrade a project to new SDK Project style, but then later you checkout a old commit with old project type and then it is required to delete obj/bin folder like @k0zi already stated. In my case it was important to close Visual Studio during deleting. |
Details about Problem
NuGet version: NuGet Client Dev\5.10.0.7140
VS Version: Main\31021.18
OS Version: Windows-10-Enterprise-20h1
Repro steps and/or sample project
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<RestoreLockedMode>true</RestoreLockedMode>
Expected
Only expected error NU1004 shows on error list when building the solution.
Actual
Unexpected error “Your project file doesn’t list ‘win’ as a “RuntimeIdentifier”” occurs when building the solution as below screenshot.
Notes
The text was updated successfully, but these errors were encountered: