I set up a WinUI 3 project for .NET 8.0 a few weeks ago.
In the beginning I encountered a problem that has been described on StackOverflow before here.
Searching for the error code (NETSDK1083) also lead me to a microsoft page where the error was explained here.
After reading through these articles and adjusting the csproj file of my project, removing the “10” from the RIDs, the project started successfully and I did not hear of this error until now.
Today I added a UnitTest project via MSTestv2 and also in a different attempt with NUnit.
Both lead to the same problem:
When adding the main-project as a reference in the UnitTest project, I again run into a lot of the earlier described errors with the same error code.
The error codes when adding a UnitTest project
All of the errors I received today, link to line 90 in the file C:Program Filesdotnetsdk8.0.204SdksMicrosoft.NET.SdktargetsMicrosoft.NET.Sdk.FrameworkReferenceResolution.targets
Here the tag has the property RuntimeIdentifier inside, which reads from a variable named “RuntimeIdentifier”. As this file is supposed to stay unmodified, and I tried to hardcode a win-x64 into the property, which still did not work, I’m afraid that this is not the root cause of the problem.
Another attempt was to look for the csproj file of the newly added test project, to see if there are any mentions of RuntimeIdentifiers that still have the distro-specific RID (e.g. win10-x64 instead of win-x64). But no, even a fulltext search over the whole solution did not reveal any mention of that.
Can anyone help me here? I definitely need Unit Tests for my project and I can not imagine that this error is specific to my Windows installation.
morusi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.