Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

482
Visualizações
Visual Studio 2022 Mac M1 .NET 6, Could not load file or assembly 'Microsoft.Build

I am having an issue with .NET 6 on Visual Studio 2022 Mac M1 chip. What happens is when I want to build or clean my WebApi project I get the following error.

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.

This is what I have for dotnet --info command

.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:  839cdfb0ec

.NET SDKs installed:
  3.1.416 [/usr/local/share/dotnet/x64/sdk]
  5.0.405 [/usr/local/share/dotnet/x64/sdk]
  6.0.102 [/usr/local/share/dotnet/x64/sdk]
  6.0.200 [/usr/local/share/dotnet/x64/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 3.1.22 [/usr/local/share/dotnet/x64/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.14 [/usr/local/share/dotnet/x64/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.2 [/usr/local/share/dotnet/x64/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.22 [/usr/local/share/dotnet/x64/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.14 [/usr/local/share/dotnet/x64/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.2 [/usr/local/share/dotnet/x64/shared/Microsoft.NETCore.App]`

To install additional .NET runtimes or SDKs:
  https://aka.ms/dotnet-download

I have tried many things but none of them has worked. I would appricate any help!

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

I was facing the same issue and I was able to make it work. (also Mac M1 chip)

But I did several actions, I'm not sure which one was responsible for fixing it.

I think my problem was related to having both "Visual Studio 2019 for Mac" and "Visual Studio 2022 Preview for Mac" installed.

I've uninstalled both. Then I removed all SDK files cleaning both:

/usr/local/share/dotnet/x64

and

/usr/local/share/dotnet/

(YMMV here, I used this article to discover those paths)

Then I installed only the "Visual Studio 2022 Preview for Mac", with its net6.0 sdk.

Opened my solution and it didn't work (because my solution was net5.0).

Then I installed the old "Visual Studio 2019 for Mac" (to get the x64 net5.0 sdk installed).

And when I opened the solution in the new "VS 2022 Preview", it now worked.

At a given moment, I updated the .NET Core SDK location on Preferences:

VSPreview Preferences, then SDK Locations, then .net core

To /usr/local/share/dotnet/dotnet (which I think is the location for the net6)

I know my answer is not precise, but I count on the community help to test these steps and then I can edit it here. :)

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda