Visual Studio Build Error “csc.exe” exited with co

2020-08-12 18:05发布

Getting a csc.exe error with the .NET samples from the site. Running in a Windows 10 x64 environment; projects came in as Win 8 and were required to be retargeted to 8.1. Now the projects don't build. Turned on diagnostics logging to get the detail. Is there a way to get the full command line that is being invoked on build?

Description "csc.exe" exited with code -532462766. Project File C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.CSharp.CurrentVersion.targets Line 246

7条回答
家丑人穷心不美
2楼-- · 2020-08-12 18:35

Go to tools -> options -> projects and solutions -> build and run

and change both MSBuild project build output verbosity and MSBuild project build log file verbosity verbosity levels to Normal, build your project again and watch the output window, if nothing new shows up change verbosity level to a higher one.

查看更多
欢心
3楼-- · 2020-08-12 18:39

If you are getting this error:

Error 10 "Csc.exe" exited with code -1073741801

Try to execute the command on nuget packgae console:

Install-Package NuGetEnablePackageRestore 
查看更多
戒情不戒烟
4楼-- · 2020-08-12 18:39

try to delete "packages.config" it's worked with me.

查看更多
对你真心纯属浪费
5楼-- · 2020-08-12 18:44

This error can be generated by NuGet packages when some .dll are not available.

Delete packages folder and compile. It should restore all the NuGet packages.

查看更多
Lonely孤独者°
6楼-- · 2020-08-12 18:46

so easy, you just have to delete folder "bin" in your project and restart visual studio

Worked for me!

查看更多
老娘就宠你
7楼-- · 2020-08-12 18:50
Install-Package Microsoft.Net.Compilers -Version 1.2.1 

Worked for me!

查看更多
登录 后发表回答