Error environment:
Visual Studio 2019
1. Failed to load msbuild Toolset
Solution: https://github.com/NuGet/Home/issues/4091 , install MSBuild, or use nuget update -self
an update, the new version of NuGet has solved this problem.
2. The current .NET SDK does not support targeting .NET 6.0
If you only install .NET 6.0, you will find that it still doesn’t work, because nuget will find the SDK in vs 2019 by default. So the next vs2022 will be fine!
1. Install NET 6.0
Note: Now (June 3, 2022) there is already NET 7.0 preview, but there is no stable, and NET 7.0 can also be installed.
Click Download: Download .NET 6.0 (Linux, macOS, and Windows) .
2. Install the latest version of Visual Studio
Note: The latest version is VS 2022.
Click to enter the installation tutorial on the official website: Install Visual Studio .
3. Update nuget
Run the following command:
nuget update -self
Note: If the above command prompts that nuget is not installed, please install it first.
Click to enter the NuGet download page: Available NuGet Distribution Versions .