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.
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.
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".
After I installed it and reopened Visual Studio, the problem is gone.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With