Internal compiler error when UseDotNetNativeToolch

2019-05-20 04:41发布

问题:

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 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"/>