7

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

Kris Vandermotten
  • 10,111
  • 38
  • 49
Pippo46
  • 127
  • 2
  • 11

3 Answers3

1

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/

Jonathan Argentiero
  • 5,687
  • 8
  • 29
  • 34
Magic
  • 81
  • 5
0

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.

MattWhilden
  • 1,686
  • 13
  • 18
  • I already tried to remove that directive from the Default.rd.xml file: it does compile but then my app crashes at runtime. I read about runtime directives but I didn't really understand how to add specific directive. Can you give some useful links about it? I'll search some more and hopefully the Update 2 will help as well. – Pippo46 Jan 25 '16 at 19:08
  • If you turn on .NET Native for the DEBUG build you may see MissingMetadataExceptions of MissingRuntimeArtifactExceptions with some error messages. You'll need to chase those down a bit to resolve the issue. Admittedly this is a pretty klunky work around. – MattWhilden Jan 25 '16 at 19:15
  • I don't get any of those errors, but I get others errors that I don't understand. You can have a look here http://1drv.ms/1QwqOmX – Pippo46 Jan 25 '16 at 19:37
0

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

Pippo46
  • 127
  • 2
  • 11