更新到 VS 2022 后无法构建

Ced*_*all 4 .net visual-studio-2022

今天早上用VS2019建了一个项目。决定升级到VS2022,现在构建失败。

通过 VS 构建给我错误:

The type or namespace name 'WindowsAzure' does not exist in the namespace 'Microsoft'
Run Code Online (Sandbox Code Playgroud)

通过终端构建时,我收到一个稍微更详细的错误。

首先这个警告

C:\Program Files\dotnet\sdk\6.0.100\Microsoft.Common.CurrentVersion.targets(2304,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.WindowsAzure.Storage". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
Run Code Online (Sandbox Code Playgroud)

然后同样的错误。

如上所述。唯一改变的是 Visual Studio 的版本。

我也收到第二个错误。

error MSB4019: The imported project "C:\Program Files\dotnet\sdk\6.0.100\Microsoft\VisualStudio\v17.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the expression in the Import declaration "C:\Program Files\dotnet\sdk\6.0.100\Microsoft\VisualStudio\v17.0\WebApplications\Microsoft.WebApplication.targets" is correct, and that the file exists on disk.
Run Code Online (Sandbox Code Playgroud)

Ced*_*all 5

通过删除解决方案中的所有 obj 和 bin 文件夹。该解决方案能够再次构建。