So you’ve been working hard away developing your app. Everything works fine when you compile using Debug and then you go to compile in Release and it all goes wrong. The compiler takes a very long time to do anything and then comes back with some cryptic errors like the following:
- STARTPROCESSTASK : error : Out of Memory
- \ilc\IlcInternals.targets(1192,5): error : Internal Compiler Error
- nutc_driver.exe returned exit code 1
So what’s happening here? When you compile for the store your app must use the .NET Native toolchain.
This is ticked under your Advanced Compile Options under your App Properties page in the Compile section for each of your Release configurations but not for Debug.
You could turn this off but then your app submission to the store won’t be accepted.
So how do we fix it?
I’ll save your hours of work, the fix was really simple in the end. It’s your anti-virus software! Close all other apps apart from Visual Studio, disable the real time protection of your anti-virus software and try building again. It’ll still take a long time but it should build now.
You might want to check out my other blog post on Anti-virus and Performance settings in Visual Studio.
If disabling your anti-virus didn’t fix it then there’s something much more going wrong.
Ensure that all of your NuGet packages are up to date and the right versions for your environment. If still no go then you’re going to have to work through the compile output and see if you can find the cause:
- Open up the Tools -> Options menu in Visual Studio and click on Projects and Solutions -> Build and Run -> MSBuild project build output verbosity and set this to Diagnostic
- Build your app again and wait for it to complete (even if takes ages) until the Build Output window fills up with all of the build information.
- Copy and paste this into Notepad++ (or another text editor that can handle large files)
- From the top of the file start searching for the text ‘error’. Ignore lines where parameters are being set (such as RestoreContinueOnError = WarnAndContinue). Look for actual errors in the output
- When you find an error google it and see what you can find to resolve it