9

This is the line that gives me the error.

<Exec Command="&quot;$(MonoGameContentBuilderExe)&quot;
/@:&quot;%(ContentReferences.FullPath)&quot; $(Header)"
WorkingDirectory="%(ContentReferences.RootDir)%(ContentReferences.Directory)" />

It is from the MonoGame.Content.Builder.targets file.

The full error is:

The command ""C:\Program Files (x86)\MSBuild\MonoGame\v3.0\Tools\MGCB.exe" /@:"C:\Users\Jake\documents\visual studio 2015\Projects\FirstGame\FirstGame\Content\Content.mgcb" /platform:Windows /outputDir:"C:\Users\Jake\documents\visual studio 2015\Projects\FirstGame\FirstGame\Content\bin\Windows" /intermediateDir:"C:\Users\Jake\documents\visual studio 2015\Projects\FirstGame\FirstGame\Content\obj\Windows" /quiet" exited with code -532462766.

I have been converting this game from Visual Studio 2010 to Visual Studio 2015, which is when this error started. Does anyone have any insight into what may be causing this?

Mohit S
  • 13,723
  • 6
  • 34
  • 69
Jake
  • 337
  • 1
  • 3
  • 15
  • 1
    Look at Hans Passant's comment [here](http://stackoverflow.com/questions/14711633/my-c-sharp-application-is-returning-0xe0434352-to-windows-task-scheduler-but-it) about that exact error code. – Cheers and hth. - Alf Sep 29 '15 at 04:20
  • 1
    Oh, and [someone named Igor states](http://ig2600.blogspot.no/2011/01/why-do-i-keep-getting-exception-code.html) "Exception code e0434352 is the exception code used internally by the CLR to represent most exceptions". – Cheers and hth. - Alf Sep 29 '15 at 04:24
  • To find the above info I (1) converted the exit code to hex (by evaluating `-532462766 + 2**32` and then `hex(_)` in Python), and (2) googled the result. – Cheers and hth. - Alf Sep 29 '15 at 04:25

2 Answers2

6

It turned out that I was attempting to load in an image file made in gimp which has an unsupported file type. I just needed to export it as a png and it worked fine.

Jake
  • 337
  • 1
  • 3
  • 15
6

In my case, the same error code was being thrown by the roslyn compiler when trying to compile cshtml files.

Turns out that the issue was being caused due to roslyn compiler version mismatch. Let me try and explain the problem:

  • My csproj had nuget references to roslyn compiler assemblies (Microsoft.Net.Compilers and Microsoft.CodeDom.Providers.DotNetCompilerPlatform).
  • I use git for source control
  • I had recently updated to the latest version of roslyn compiler on DEV branch
  • But my MASTER branch was still referencing the previous version of roslyn compiler and I was not yet ready to merge DEV to MASTER
  • Switching from dev to master branch from team explorer did not seem to trigger "nuget restore" for the mismatched packages

So manually deleting all the folders in the packages folder and performing a "nuget restore" resolved this error for me.

Raghu
  • 1,415
  • 13
  • 18
  • 1
    I got this error from the VB compiler when compiling a solution. The message there was "vbc.exe" exited with code -532462766 Clearing all NuGet packages and restoring them with the same version across projects solved the problem – Colin Jun 15 '17 at 10:44
  • 1
    Your answer just solved my problem. Upgraded Roslyn to version 2.0.1 just solved my problem in VS 2015. VB compiler is crazy. – papfan Jun 28 '17 at 15:25