Could not load file or assembly 'System.Security.Principal.Windows'

后端 未结 9 725
不思量自难忘°
不思量自难忘° 2021-02-06 20:29

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

The specified task executable \"csc.exe\

9条回答
  •  日久生厌
    2021-02-06 21:16

    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.

提交回复
热议问题