Various problems caused by .Net Native

12/25/2018

Various problems caused by .Net Native

More than 90% of problems and performance issues of UWP app are caused by .Net Native introduced by Microsoft unnecessarily:

Here is a partial list:

  • error CS0518: Predefined type 'System.String' ('System.Void'),  is not defined or imported. Solution: delete folders bin and obj of the app project and library projects referenced by the app.
  • C:\Users\h\.nuget\packages\microsoft.net.native.compiler\2.1.8\tools\Microsoft.NetNative.targets(788,5): error : Unhandled Exception: System.InvalidCastException: Specified cast is not valid ...   Solution: restart VS, then create the app package.
  • C:\Users\h\.nuget\packages\microsoft.net.native.compiler\2.1.8\tools\Microsoft.NetNative.targets(788,5): error : ILT0005: 'C:\Users\h\.nuget\packages\runtime.win10-x86.microsoft.net.native.compiler\2.1.8\tools\x86\ilc\Tools\nutc_driver.exe @"...\AppName\obj\x86\Release\ilc\intermediate\MDIL\AppName.rsp"' returned exit code -1073741819
  • C:\Users\h\.nuget\packages\microsoft.net.native.compiler\2.1.8\tools\Microsoft.NetNative.targets(788,5): error MSB6006: "ilc.exe" exited with code -1073741819. Solution: 1. clean the solution; 2. Exit VS. 3. delete all delete folders bin and obj of the app project and all projects referenced by the project.