【发布时间】:2021-12-24 07:46:20
【问题描述】:
我将 Visual Studio Community 升级到最终版本,但它停止工作。具体来说,我可以生成一个新项目,但是当我尝试加载它时,它给了我一个错误
关键项目“SdkTest”加载失败| [MSB4236] 找不到指定的 SDK“Microsoft.NET.Sdk.Web”。 ...\SdkTest.csproj
即使构建和运行正常
我在 VS2022 上运行了“修复”,现在它似乎可以在 Visual Studio 中运行了。但是,dotnet --info 不显示 任何 SDK;只有运行时;和dotnet build 或dotnet new 给出错误:
C:\Code>dotnet new console -o myapp
Could not execute because the application was not found or a compatible .NET SDK is not installed.
Possible reasons for this include:
* You intended to execute a .NET program:
The application 'new' does not exist.
* You intended to execute a .NET SDK command:
It was not possible to find any installed .NET SDKs.
Install a .NET SDK from:
https://aka.ms/dotnet-download
我什至重新安装了 .NET 6,并在应用程序列表中看到了它(以及较旧的 SDK)。我检查了路径,我看到了我希望看到的一切:
C:\Program Files (x86)\dotnet\
C:\Program Files\dotnet\
C:\Users\me\.dotnet\tools
我正在运行 Windows 11。
【问题讨论】:
-
Program files应该在Program files (x86)之前,这是已知的错误。 Fix -
@JL0PD - 你想把它作为答案吗?我会欣然接受。我在谷歌上搜索各种搜索词 - 从来没有偶然发现那个 github 问题
标签: .net-core msbuild visual-studio-2022