How to successfully build a Microsoft.Dotnet.Wpf.sln repository downloaded from GitHub at your home PC?

50 Views Asked by At

I am trying to build a Microsoft.Dotnet.Wpf.sln which I downloaded from GitHub here. I installed Visual Studio 2022 Preview as mentioned in the instruction. Now when I open the Microsoft.Dotnet.Wpf.sln in VS2022 I get warning

Current solution contains incorrect configurations mappings. It may cause projects to not work correctly

I tried to Restore nuget package for solution, still I can see unresolved dependencies. enter image description here

The Nuget package source are

enter image description here

Is there any guidance and steps to follow to successfully build this repo?

1

There are 1 best solutions below

1
Bowman Zhu-MSFT On

I am able to reproduce your situation:

enter image description here

You can take a look at another answer of mine about why this happens:

https://stackoverflow.com/a/77514819/6261890

And for your situation, you can use a simple method to avoid this:

Close your visual studio, open the Microsoft.Dotnet.Wpf.sln file via text editor, and remove everything between GlobalSection(ProjectConfigurationPlatforms) = postSolution and EndGlobalSection.

Make it like this:

enter image description here

Save it, and then open it via visual studio.

After that, the issue you encountered should disappear.

By the way, I checked the info of the projects, it related to .net sdk 9.0. So please also use the latest visual studio version which support the .net sdk 9.0.

And to avoid other problems, I suggest you using official NuGet source:

https://api.nuget.org/v3/index.json