12
votes

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

8
this is a generic CLR exception code 0xE0434352. capture a crash dump of csc.exe (procdump -ma -i C:\dumps) and analyze it with windbg (at end of this link: ig2600.blogspot.de/2009/07/…)magicandre1981
Delete the bin and obj folder in project(s). The try to clean and rebuild the solutionThe Blue Shirt Developer
I have the exact same error with a similar setup. Were you able to solve this issue? There is very little info about it online.Xavier Peña
In my case it might look like it is a compiler error that is not recognized by Visual Studio. Other projects work just fine, but after applying a big refactoring to the project I'm working on this error suddenly happened and it won't go away.Xavier Peña
Nevermind, I have solved it by re-doing the refactoring from scratch. This time it works perfectly.Xavier Peña

8 Answers

18
votes
Install-Package Microsoft.Net.Compilers -Version 1.2.1 

Worked for me!

4
votes

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.

0
votes

I couldn't find out the reason of this, but a rollback of project settings to default solved the case for me. I guess Visual Studio 2015 somehow mixed up it's settings.

0
votes

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.

0
votes

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

Worked for me!

0
votes

This was happening to me yesterday.

Not sure if it was related, but this problem started for me soon after a /bin and /obj folder delete to cure another build issue.

I tried every suggestion on here and elsewhere, but in the end the only thing that worked was closing all my code files that were open in the IDE. Seems bonkers to me that this is really the cure, but if it saves someone 6 hours of their life then it's worth a shot.

-3
votes

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 
-3
votes

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