Visual Studio Build Error "csc.exe" exited with code -532462766
Asked Answered
T

8

13

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

Tablecloth answered 2/12, 2015 at 3:24 Comment(6)
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/…)Immodest
Delete the bin and obj folder in project(s). The try to clean and rebuild the solutionMadelon
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.Kerry
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.Kerry
Nevermind, I have solved it by re-doing the refactoring from scratch. This time it works perfectly.Kerry
I cleaned the project that caused the error, and then it worked. MS works in mysterious ways :PKalif
O
18
Install-Package Microsoft.Net.Compilers -Version 1.2.1 

Worked for me!

Or answered 11/5, 2016 at 8:49 Comment(8)
This worked for me, although the version number i was at was 1.2.2 and i went up to 1.3.2. Apparently microsoft likes to keep breaking things in their compilers.Mariko
Well, i installed 1.3.2 version through "Manage NuGet Packages for Solution". Error changed to ""csc.exe" exited with code 255". Still searching for solution.Heated
Did you check your references? Is it still 1.0.0 or changed?Or
Worked for me too, I had updated one project to .net 4.6.1 when it was 4.5 along with it's sister projects. Used the latest version 1.3.2Millet
@IuriFarenzena When I send this answer, latest version was 1.2.1. If you don't specify a version, it brings the latest version and solves the problem too.Or
Be sure to look up the correct version for the version of the .Net Framework you are using. You can find more information at nuget.org/packages/Microsoft.Net.CompilersWreckful
When I post the message, I guess the existing version was 1.2.1 that's why I typed it statically. Sure, you should check the appropriate version for your app. you are right @WreckfulOr
Worked for me too. I didn't specify any version and installed the latest Install-Package Microsoft.Net.CompilersOverarch
H
4

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.

Honorarium answered 21/7, 2016 at 16:52 Comment(0)
H
0

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.

Heated answered 21/12, 2016 at 8:48 Comment(0)
E
0

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.

Epigoni answered 9/5, 2017 at 13:26 Comment(0)
K
0

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

Worked for me!

Kiyokokiyoshi answered 6/1, 2018 at 19:8 Comment(0)
B
0

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.

Basildon answered 9/12, 2020 at 10:1 Comment(0)
I
-3

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 
Illuminance answered 11/12, 2015 at 11:31 Comment(0)
T
-3

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

Tarweed answered 12/3, 2017 at 22:34 Comment(1)
At least provide the path to where the file lives. And is there a reason why this file should be deleted? Is the user going to lose any possible data on deleting this file. Your answer would be useful if you can improve it a little bit.Heidi

© 2022 - 2024 — McMap. All rights reserved.