UseDotNetNativeToolchain 为真时出现内部编译器错误

Internal compiler error when UseDotNetNativeToolchain is true

我有一个 UWP 应用程序,如果我关闭 UseDotNetNativeToolchain,它可以成功编译。但是当我打开它时,它给了我一个神秘的错误:

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

这就是它给我的全部。是什么原因造成的?我该如何深入研究。

使用VS2015

以下是完整的构建输出以防万一:

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

此问题的解决方案是禁用我在 Default.rd.xml 文件中使用的几个程序集中的优化。例如

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