7
votes

I built a Universal App for windows 10 and I didn't know about the Native Tool chain. When I was ready to create the package I got many errors and I looked for a solution without any luck.

After a few attemps I decided to take my app, piece by piece, in a test project to see what is wrong and I get the following errors after I added the ViewModelLocator of Mvvm Light 5.2:

NUTC300F:Internal Compiler Error: Native compilation failed due to out of memory error
ILT0005: 'C:\Program Files (x86)\MSBuild\Microsoft\.NetNative\x86\ilc\Tools\nutc_driver.exe 
    @"C:\...\Test\obj\x86\Release\ilc\intermediate\MDIL\Test.rsp"' returned exit code 1
Warning  Method 'CreateLambda' within 'System.Linq.Expressions.Expression' could not be found.
    C:\....\Test\Resources.System.Linq.Expressions.rd.xml 35 
Warning  Method 'ParameterIsAssignable' within 'System.Linq.Expressions.Expression' could not be found.
    C:\....\Test\Resources.System.Linq.Expressions.rd.xml 91 

And this is my ViewModelLocatorClass

public class ViewModelLocator
{
    public const string HeroDetailsPageName = "HeroDetails";

    public ViewModelLocator()
    {
        ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);

        var nav = new NavigationService();
        nav.Configure(HeroDetailsPageName, typeof(HeroDetails));
        SimpleIoc.Default.Register<INavigationService>(() => nav);

        SimpleIoc.Default.Register<IDialogService, DialogService>();

        if (ViewModelBase.IsInDesignModeStatic)
        {
            SimpleIoc.Default.Register<IHotSRepository, DesignDataSource>();
        }
        else
        {
            SimpleIoc.Default.Register<IHotSRepository, HotSRepository>();
        }

        SimpleIoc.Default.Register<MainViewModel>();
    }

    public MainViewModel Main => ServiceLocator.Current.GetInstance<MainViewModel>();
}

I am also using SQLite3, ef7 rc1, Newtosoft Json and HTML agility pack. I already followed all the suggestions to make EF7 compile. I deleted the obj folder, restarted Visual Studio an looked for all the thread about the problem without any luck. My machine has 16GB of memory and, looking at the task manager, I had around 50% free memory when I got the error.

I hope someone can help me some how.

Thanks,

Pippo

3
The warnings can be safely ignored. See here: github.com/dotnet/corefx/issues/5088MattWhilden
Thanks, i'll give it a try, but now I think that the OOM it is not related to that warnings.Pippo46

3 Answers

1
votes

Probably, you are using a non-english UI for Visual Studio 2015 Update 2 and trying to build a release version of your UWP app.

Download the Language pack: http://go.microsoft.com/fwlink/?LinkId=647001&clcid=0x409

Credits: http://pwnd.io/uwp-release-compile-error-ilt0005/

0
votes

You may try removing the *Application* directive from this file: Properties\Default.rd.xml. It instructs the .NET Native compiler to be overly generous about information it saves/generates and may be a contributing factor to the OOM. The more conservative behavior allowed by removing this directive may free up enough extraneous work as to allow the compiler to complete. However, this opens you up to the compiler potentially over optimizing your application so you'll need to carefully test it in this configuration and may need to add back some more specific directives to the .rd.xml file in order to get completely back on your feet.

We have some fixes coming in Update 2 that should help applications like yours that rely on many frameworks with heavy reflection/high numbers of generics.

0
votes

I have solved all my issues after i have installed visual studio 2015 update 3 and switched from EF7 to EF core also available via nuget