且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用.Net本机在发布模式下编译UWP应用时出现内存不足错误

更新时间:2023-01-02 20:28:54

我遇到了同样的问题(我也在使用EF7和其他库),但是我使用后,我已经解决了所有问题.EF核心也可以通过nuget获得

I have a solution where my main project is a uwp app, and two other projects referenced by the app :

  1. UWP App ---> references 2.
  2. Universal Class library ----> references 3.
  3. PCL Library

2 --> uses EF7 and SQLight.

3 --> uses PCLCrypto

Now, everything works just fine and excellent when I'm on Debug mode x86 targeting local machine.

I want to compile the solution in release mode using .Net native tool chain, here's my config :

When I launch the compilation, it takes a remarkably long time, and too much memory is consumed by the .Net native tools :

After some time, everything stops with 2 errors on visual studio :

Here's what the output window says :

1>------ Build started: Project: ServerCommunication, Configuration: Release Any CPU ------ 1> ServerCommunication -> C:\Users\aymen\Documents\Visual Studio 2015\Projects\Applinova\Liberte\ServerCommunication\bin\Release\ServerCommunication.dll 2>------ Build started: Project: NewspaperDataLayer, Configuration: Release x86 ------ 2>C:\Users\aymen\Documents\Visual Studio 2015\Projects\Applinova\Liberte\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets(225,5): warning : All projects referencing ServerCommunication.csproj must install nuget package Microsoft.Bcl.Build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317569. 2> NewspaperDataLayer -> C:\Users\aymen\Documents\Visual Studio 2015\Projects\Applinova\Liberte\NewspaperDataLayer\bin\x86\Release\NewspaperDataLayer.dll

3>------ Build started: Project: Liberte, Configuration: Release x86

--some warnings here that I just skipped

3> Starting .NET Native compilation 3> Processing application code 3>C:\Users\aymen\Documents\Visual Studio 2015\Projects\Applinova\Liberte\Liberte\Resources.System.Linq.Expressions.rd.xml(35): warning : Method 'CreateLambda' within 'System.Linq.Expressions.Expression' could not be found. 3>C:\Users\aymen\Documents\Visual Studio 2015\Projects\Applinova\Liberte\Liberte\Resources.System.Linq.Expressions.rd.xml(91): warning : Method 'ParameterIsAssignable' within 'System.Linq.Expressions.Expression' could not be found. 3> Computing application closure and generating interop code 3> Generating serialization code 3> Compiling interop code 3> Cleaning up unreferenced code 3> Generating native code 3>STARTPROCESSTASK : error : Out of Memory 3>C:\Program Files (x86)\MSBuild\Microsoft.NetNative\x86\ilc\IlcInternals.targets(1129,5): error : ILT0005: 'C:\Program Files (x86)\MSBuild\Microsoft.NetNative\x86\ilc\Tools\nutc_driver.exe @"C:\Users\aymen\Documents\Visual Studio 2015\Projects\Applinova\Liberte\Liberte\obj\x86\Release\ilc\intermediate\MDIL\Liberte.rsp"' returned exit code 1 ========== Build: 2 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== ========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========

What would possibly be wrong with this please ??

I had the same problem (I am also using EF7 and other libraries) but I solved using Visual Studio 15 preview (it is not visual studio 2015 update 2, which I didn't try). They improved the .NET native tools so now you should not have any problem, even if using a lot of third party library.

UPDATE

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