4
votes

I have a UWP app that compiles successfully if I have UseDotNetNativeToolchain off. But when I turn it on, it gives me the cryptic error:

Internal compiler error: Object reference not set to an instance of an object. UWPApp C:\Program Files (x86)\MSBuild\Microsoft.NetNative\x86\ilc\IlcInternals.targets 887 Build

This is all it gives me. What could be causing this? How can I drill down on this.

Using VS2015

Here is the full build output in case that helps:

https://gist.github.com/shannah/e24fe8456313fb9ad98577c9a812f357

1
The .NET Native compiler crashed, that happens. You first need to check if a Hello World app can compile, if not then it is an environmental problem. If it survives then comment chunks out in your source code to narrow down the trouble. Calling Microsoft Support would be wise. - Hans Passant
Did you solve the issue? - Dominic
Did Anyone solve this issue? - DemetrioProgramerOsorio
Yes. I added the solution as an answer just now. - steve hannah

1 Answers

1
votes

The solution to this problem was to disable optimization in a few assemblies I was using in the Default.rd.xml file. E.g.

 <Assembly Name="IKVM.OpenJDK.Core" Dynamic="All" DoNotInline="true" DoNotOptimize="true"/>