使用.Net本机在发布模式下编译UWP应用时出现内存不足错误 [英] Out of memory error when compiling UWP app in release mode with .Net native

查看:66
本文介绍了使用.Net本机在发布模式下编译UWP应用时出现内存不足错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个解决方案,其中我的主要项目是uwp应用程序,该应用程序引用了另外两个项目:

  1. UWP应用--->参考2.
  2. 通用类库---->参考3.
  3. PCL库

2->使用EF7和SQLight.

3->使用

当我启动编译时,它花费了相当长的时间,并且.Net本机工具消耗了太多的内存:

一段时间后,Visual Studio上的所有操作都会停止并出现2个错误:

这是输出窗口显示的内容:

1> ------构建开始:项目:ServerCommunication,配置:释放任何CPU ------ 1> ServerCommunication->C:\ Users \ aymen \ Documents \ Visual Studio2015 \ Projects \ Applinova \ Liberte \ ServerCommunication \ bin \ Release \ ServerCommunication.dll2> ------开始构建:项目:NewspaperDataLayer,配置:发布x86 ------ 2> C:\ Users \ aymen \ Documents \ Visual Studio2015 \ Projects \ Applinova \ Liberte \ packages \ Microsoft.Bcl.Build.1.0.14 \ tools \ Microsoft.Bcl.Build.targets(225,5):警告:所有引用ServerCommunication.csproj的项目都必须安装nuget包Microsoft.Bcl.Build.有关更多信息,请参见 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> ------构建开始:项目:Liberte,配置:x86版本

-在此我刚刚跳过了一些警告

3>开始.NET本机编译3>处理应用程序代码3> C:\ Users \ aymen \ Documents \ Visual Studio2015 \ Projects \ Applinova \ Liberte \ Liberte \ Resources.System.Linq.Expressions.rd.xml(35):警告:方法"CreateLambda"内找不到"System.Linq.Expressions.Expression".3> C:\ Users \ aymen \ Documents \ Visual Studio2015 \ Projects \ Applinova \ Liberte \ Liberte \ Resources.System.Linq.Expressions.rd.xml(91):警告:方法"ParameterIsAssignable"内找不到"System.Linq.Expressions.Expression".3>计算应用程序关闭并生成互操作代码3>生成序列化代码3>编译互操作代码3>清理未引用的代码3>生成本机代码3> STARTPROCESSTASK:错误:内存不足3> C:\ Program Files(x86)\ MSBuild \ Microsoft.NetNative \ x86 \ ilc \ IlcInternals.targets(1129,5):错误:ILT0005:'C:\ Program文件(x86)\ MSBuild \ Microsoft.NetNative \ x86 \ ilc \ Tools \ nutc_driver.exe@"C:\ Users \ aymen \ Documents \ Visual Studio2015 \ Projects \ Applinova \ Liberte \ Liberte \ obj \ x86 \ Release \ ilc \ intermediate \ MDIL \ Liberte.rsp'返回的退出代码1==========构建:2成功,1失败,0最新,跳过0 =====================部署:0成功,0失败,0跳过==========

这可能有什么问题吗?

解决方案

我遇到了同样的问题(我也在使用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

这篇关于使用.Net本机在发布模式下编译UWP应用时出现内存不足错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆