3
votes
  1. Create in a Visual Studio 2017 a blank UWP app
  2. Install NuGet package Microsoft.Net.Native.Compiler 2.0.2 (tested at 2.0.0 and 2.0.1 too)
  3. Switch to Release mode, where option "Compile with .NET Native tool chain" is turned on
  4. Try to run the app

Error: Internal compiler error: Could not load assembly '\App1\obj\x86\Release\ilc\in\System.Data.dll\System.Data.dll'

caused by line 731 in C:\Users\User.nuget\packages\microsoft.net.native.compiler\2.0.2\tools\Microsoft.NetNative.targets

Additional info:

  1. By default a blank UWP app creates with NuGet package Microsoft.NETCore.UniversalWindowsPlatform version 6.0.4 and the latest one is 6.0.5. I tried with both versions.
  2. Tried to skip this problematic task commenting it in Microsoft.NetNative.targets file. The original problem has gone, but another problems appeared, so I stopped moving in this direction.
  3. I see that Stack Overflow already has issues with System.Data.dll, but I wasn't able to find relevant to my case.
1

1 Answers

4
votes

Error: Internal compiler error: Could not load assembly '\App1\obj\x86\Release\ilc\in\System.Data.dll\System.Data.dll'

Actually, the Microsoft.NETCore.UniversalWindowsPlatform version 6.0.5 contains .NET native compilers 2.0.2. You have no need to install Microsoft.Net.Native.Compiler 2.0.2 individually.

enter image description here

And Microsoft.Net.Native.Compiler 2.0.2 is only available in Windows 10 Fall Creators Update (10.0;build 16299). if it has been installed individually, you need to modify your target min version to 16299.