我在 Visual Studio 2022 Mac M1 芯片上遇到 .NET 6 问题。发生的情况是,当我想要构建或清理我的 WebApi 项目时,出现以下错误。
The operation failed due to an internal error: Could not load file or assembly 'Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. An attempt was made to load a program with an incorrect format.
Run Code Online (Sandbox Code Playgroud)
这就是我的 dotnet --info命令
.NET SDK (reflecting any global.json):
Version: 6.0.200
Commit: 4c30de7899
Runtime Environment:
OS Name: Mac OS X
OS Version: 12.2
OS Platform: Darwin
RID: osx.12-x64
Base Path: /usr/local/share/dotnet/x64/sdk/6.0.200/
Host (useful for support):
Version: 6.0.2
Commit: …Run Code Online (Sandbox Code Playgroud) c# .net-core asp.net-core-webapi .net-6.0 visual-studio-2022