解决方案已经编译成功,但是我在项目中添加一个已经存在的类文件后,出现了这个错误:
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
我通过 NuGet 安装了 System.Security.Principal.Windows
包,但仍然出现错误。
最佳答案
之前的答案都不适合我。
问题是我没有安装 .NET Compiler Platform SDK。
要解决,请打开 Visual Studio 安装程序,选择“修改”,然后在“单个组件”选项卡下,选中 .NET Compiler Platform SDK,然后单击“修改”确认您的更改。
我安装它并重新打开 Visual Studio 后,问题就消失了。
关于c# - 无法加载文件或程序集 'System.Security.Principal.Windows',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51909212/