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

949
Visualizações
Could not load file or assembly 'System.Security.Principal.Windows'

Solution has compiled successfully, but after I added an existing class file to the project, this error appeared:

The specified task executable "csc.exe" could not be run. Could not load file or assembly 'System.Security.Principal.Windows, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. MvcApplicationRegister

I installed System.Security.Principal.Windows package By NuGet, but error still appears.

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

0

In my case I could go from Microsoft.Net.Compilers 2.4.0 to Microsoft.Net.Compilers 2.10.0. No need to use Microsoft.Net.Compilers 2.8.2.

over 4 years ago · Santiago Trujillo Relatório

0

Updating Microsoft.CodeDom.Providers.DotNetCompilerPlatform and deleting Microsoft.Net.Compilers worked for me.

over 4 years ago · Santiago Trujillo Relatório

0

Close down all instances of Visual Studio. Then reopen the solution and rebuild.

over 4 years ago · Santiago Trujillo Relatório

0

I do not like removing packages without first understanding what I'm removing. I faced the same problem with my solution.

I discovered that 1 of the many projects was using the Microsoft.Net.Compilers NuGet package - let's call it Project ABC. A Unit Test project was referencing that Project ABC, but not the Microsoft.Net.Compilers NuGet package.

I simply referenced the Microsoft.Net.Compilers NuGet package from my Unit Test project, and the problem has now gone away.

over 4 years ago · Santiago Trujillo Relatório

0

If you are using Microsoft.CodeDom.Providers.DotNetCompilerPlatform you can upgrade to 2.x and then remove Microsoft.Net.Compilers as it's no longer needed. That solved it for me, however I couldn't even build the solution in the first place. It was still complaining about System.Security.Principal.Windows though, I could also solve it by referencing System.Security as an assembly. It's not recommended though.

over 4 years ago · Santiago Trujillo Relatório

0

Had this same issue and resolved it.

In a 3 project solution MVC controller (Web,Business,Data)

Caused by the Microsoft.Net.Compiler 2.9.0 being installed on the Web project but not the other projects.

To resolve: Right click the solution. Manage NuGet Packages. Installed > Search for the compiler Ensure it is the same version and it is installed on all projects in your solution

Once installed my solution built successfully

over 4 years ago · Santiago Trujillo Relatório

0

I had the same issue after I upgraded Microsoft.Net.Compiler from 2.8.2 to 2.9.0. After I downgraded to 2.8.2 projects compiled without any errors.

over 4 years ago · Santiago Trujillo Relatório

0

I uninstalled both Microsoft.CodeDom.Providers.DotNetCompilerPlatform and Microsoft.Net.Compilers and everything now works.

over 4 years ago · Santiago Trujillo Relatório

0

None of the previous answers worked for me.

The problem was that I didn't have the .NET Compiler Platform SDK installed.

To solve, open Visual Studio Installer, choose "Modify", and under the "Invididual Component" tab, check the .NET Compiler Platform SDK, and confirm your changes by clicking "Modify".

enter image description here

After I installed it and reopened Visual Studio, the problem is gone.

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