.Net Native raises ILT0005 when compiling UWP project in Release configuration

Marco Enxuto 326 Reputation points
2020-07-15T00:35:49.27+00:00

Hi,
I've been searching online for this error, here and on MSDN Foruns and none of them have the answer.
My project has the following configuration:
TargetPlatformMinVersion 10.0.15063.0
TargetPlatformVersion 10.0.17763.0

Log info:
x64 compiler

C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\microsoft.net.native.compiler\1.7.6\tools\Microsoft.NetNative.targets(697,5): error : ILT0005: 'C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\microsoft.net.native.compiler\1.7.6\tools\x64\ilc\Tools\nutc_driver.exe @"C:\Users\marco\Source\Workspaces\App1\Dev\App1\obj\x64\Release\ilc\intermediate\MDIL\App1.rsp"' returned exit code 1

x86 compiler

C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\microsoft.net.native.compiler\1.7.6\tools\Microsoft.NetNative.targets(697,5): error : ILT0005: 'C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\microsoft.net.native.compiler\1.7.6\tools\x86\ilc\Tools\nutc_driver.exe @"C:\Users\marco\Source\Workspaces\App1\Dev\App1\obj\x86\Release\ilc\intermediate\MDIL\App1.rsp"' returned exit code 1

The project uses several nuget packages. See the picture for more details. Also, i read somewhere that having several nuget packages, could cause this issue with the compiler.
12261-annotation-2020-07-15-013720.png

Here's the workarounds i tried based on my online findings:

I'm out of options. Looks like this issue still exists but only happens with my project on several machines i tested. Even a device with 40GB of RAM, since i learned the compiler crashes with the lack of memory. I didn't see that info on the compiler log though.

I activated the VS Diagnostics verbosity and log for more details, but i only found the lines described above with that relevant information.

I have VS2019 16.6.4 installed today.

Universal Windows Platform (UWP)
{count} votes

3 answers

Sort by: Most helpful
  1. Steven Blom 6 Reputation points
    2022-10-12T08:44:14.243+00:00

    I've just hit upon this error myself and spent most of the day looking into it.

    I've traced it down to the fact that even with a 64-bit compile toolchain, nutc_driver is still 32-bit.

    The root cause of my issue was that I was using a 16-core Virtual Machine to host my agent, and with more cores, means more work in parallel, which means more memory consumed.

    The solution in my case was to drop back the number of cores in my VM to 8, that limits the amount of memory consumed and allows the process to work.

    Ideally MS would update the toolchain to include a 64-bit nutc_driver, which would solve the problem.

    1 person found this answer helpful.

  2. Alex K 1 Reputation point
    2021-03-12T05:32:48.947+00:00

    I'm having similar issue but probably worse. Can anybody help me out with resolving it? I'm using Google.Apis.Drive.v2 version 1.25.0.862. It looks like this is the last version that is supposed to work on UWP all versions after that have a remark that they will build but won't work. When I build the app with this version I have no compile errors but in runtime I have this exception when I call anything from Google.Apis.Drive.v2

    System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
    File name: 'Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
    at Google.Apis.Auth.OAuth2.AuthorizationCodeInstalledApp.AuthorizeAsync(String userId, CancellationToken taskCancellationToken)
    at Google.Apis.Auth.OAuth2.AuthorizationCodeWindowsInstalledApp.<AuthorizeAsync>d__7.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at Google.Apis.Auth.OAuth2.GoogleWebAuthorizationBroker.<AuthorizeAsync>d__1.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
    at MgScopes.Net.GoogleDrive.GoogleDriveStorage.<CreateAsync>d__26.MoveNext()

    I figured out that if I reference Microsoft.Bcl.Async version 1.0.168 everything works in runtime. Frankly speaking I don't remember now why I chose this version and I didn't try others. Anyway this is something old and was intended for VS 2012 if the description is right. So, after I do that I cannot build an application package for publishing, I'm getting that ILT0005. If I remove Microsoft.Bcl.Async the package builds but google drive does not work. How to resolve this?

    Thank you,
    Alex


  3. Hong 1,046 Reputation points
    2021-07-10T03:09:44.12+00:00

    A method has worked twice to resolve the same error ILT0005. Let me report it here.

    VS builds the packages of the release bundle of an app in the following order: x86, x64, ARM.

    Case 1: It always failed at .rsp of the x64 package. I tried many times to no avail.
    I did the following:

    1. Built x64 package only and it succeeded.
    2. Built the bundle with all 3 packages and it succeeded.

    Case 2: It always failed at .rsp of the ARM package.
    I did the following:

    1. Built ARM package only and it succeeded.
    2. Built the bundle with all 3 packages and it succeeded.

    I have no clue why this method worked.