«Фатальная ошибка N1002: недостаточно памяти»: не удалось создать выпуск UWP после успешного создания mdilexe - PullRequest
1 голос
/ 27 мая 2020

1. Резюме У меня есть проект UWP в кроссплатформенном решении Xamarin (с Microsoft Visual Studio Enterprise 2019 версии 16.6.0), с использованием библиотеки. Net Standard 2.0, UWP с использованием последней Windows 10 версии 1903 (сборка 18362) и он может успешно работать при отладке (также проект Android может успешно отлаживаться на реальном телефоне). Но когда я перехожу к выпуску и создаю пакеты приложений, не получается "Недостаточно памяти". Процесс сборки почти 15 минут, а системная память (12 ГБ) наконец-то заканчивается до отказа. Компилятор успешно сгенерировал mdilexe, но внезапно завершился ошибкой. Возможно, это новая ошибка, я не могу найти подобного случая.

2. сообщение об ошибке Сводка ilclog.csv

 Message    Normal  Transform summary   
Message Normal      ms | heap delta | name  
Message Normal  265805 |       1300 | Analysis  
Message Normal   52943 |      -1221 | Reducer   
Message Normal   44998 |        245 | CreateMetadata    
Message Normal   33212 |        313 | Mcg   
Message Normal   32044 |          4 | GenerateCodeAndCompile    
Message Normal   28039 |       -108 | WriteAssemblies   
Message Normal   15547 |       -127 | ReducedCopyComplete   
Message Normal   11605 |         44 | ReducedCopyInitialize 
Message Normal    5616 |         28 | McgTypeOf 
Message Normal    4547 |         66 | LazyGenerics  
Message Normal    3722 |        202 | ReducedCopyMethodBodies   
Message Normal    2571 |         45 | McgRedirect   
Message Normal    2143 |        114 | ReducedCopyPopulateTypes  
Message Normal    1963 |         18 | StaticInitData    
Message Normal    1844 |        178 | ReducedCopyLateMetadata   
Message Normal     723 |          5 | ReflectionMappingInfoEmit 
Message Normal     650 |          3 | McgRedirect   
Message Normal     509 |         18 | TypeofTypeHandle  
Message Normal     461 |         -9 | DumpNativeResources   
Message Normal     433 |          1 | ResourceExtractor 
Message Normal     333 |         12 | EventSource   
Message Normal     205 |          5 | Delegate  
Message Normal     178 |          4 | GetType   
Message Normal     172 |         32 | ReflectionInvoke  
Message Normal     162 |          4 | SaveRVAStatics    
Message Normal     158 |        -13 | ReducedCopyPassResourcesToMutableAssembly 
Message Normal     142 |          7 | McgAccessor   
Message Normal     128 |         30 | ReducedCopyEmptyTypes 
Message Normal     103 |          2 | DispatchProxyIntrinsics   
Message Normal      80 |          0 | ValueType 
Message Normal      76 |         15 | DebuggerGuidedStepThroughJmc  
Message Normal      76 |          0 | ScrubOpenCalls    
Message Normal      67 |          2 | ReflectionIntrinsics  
Message Normal      52 |          0 | StartupCodeInjector   
Message Normal      41 |          3 | McgFixups 
Message Normal      30 |          1 | ConvertCatchIntoFilter    
Message Normal      25 |          0 | DisableOptimization   
Message Normal      19 |          0 | ReducedCopyCleanup    
Message Normal      16 |          2 | Attribute 
Message Normal      12 |          1 | AddReflectionBlockedAttributes    
Message Normal       2 |          0 | ComImportDetector 
Message Normal       2 |          0 | ResourceManagerCtor   
Message Normal       1 |          0 | DeveloperExperienceModeOnlyCodeRemover    
Message Normal       0 |          1 | ConvertManagedWinMD   
Message Low Done executing task "RunILTransforms".  
Message Low Done building target "RunILTransforms" in file "ILTransforms".  
Message Low Done building project "ILTransforms".   
Message Low     
Message Low     
Message Low Done building target "GenerateMDIL" in file "Nutc". 
Message Low     
Message High    Generating native code  
Message Low Done building target "MDILPrepareMultiFile" in file "Nutc". 
Message Low     
Message Low Done building target "SetBinaryForReferences" in file "Nutc".   
Message Low     
Message Low Task "GenerateMDILGlobalAnalysis"   
Message Normal  Launching 'C:\Users\HHH\.nuget\packages\runtime.win10-x86.microsoft.net.native.compiler\2.2.8-rel-28605-00\tools\x86\ilc\Tools\nutc_driver.exe @"F:\LAB\Fifi.APP.UWP\obj\x86\Release\ilc\intermediate\MDIL\Fifi.APP.UWP.rsp"'   
Message Low Microsoft (R) MDIL Compiler - Version 2.2.28605.00  
Message Low Copyright (c) Microsoft Corporation.  All rights reserved.  
Message Low Scanning input types    
Message Low Scanning 129710 methods.    
Message Low Scanning 26658 methods. 
Message Low Scanning 13836 methods. 
Message Low Scanning 7723 methods.  
Message Low Scanning 4523 methods.  
Message Low Scanning 3401 methods.  
Message Low Scanning 3013 methods.  
Message Low Scanning 1660 methods.  
Message Low Scanning 1233 methods.  
Message Low Scanning 995 methods.   
Message Low Scanning 990 methods.   
Message Low Scanning 831 methods.   
Message Low Scanning 600 methods.   
Message Low Scanning 349 methods.   
Message Low Scanning 180 methods.   
Message Low Scanning 133 methods.   
Message Low Scanning 60 methods.    
Message Low Scanning 10 methods.    
Message Low Scanning 18 methods.    
Message Low Scanning 12 methods.    
Message Low Scanning 10 methods.    
Message Low Scanning 10 methods.    
Message Low Eager code generation   
Message Low Compiling 195955 methods.   
Message Low Deferred code generation    
Message Low Compiling 7 methods.    
Message Low Compiling 1 methods.    
Message Low Call to managed method Initialize succeeded; exit code: 0 while generating CTL.Stack trace metadata statistics  
Message Low Number of methods emitted:   66744  
Message Low Metadata blob size:          1156431    
Message Low Method RVA - token map size: 533952 
Message Low Total native size:           1690383    
Message Low Successfully generated 'F:\LAB\Fifi.APP.UWP\obj\x86\Release\ilc\intermediate\MDIL\Fifi.APP.UWP.mdilexe' 
Message Low fatal error N1002: Out of Memory    
Error       0   
Message Low Done executing task "GenerateMDILGlobalAnalysis" -- FAILED. 
Message Low Done building target "GenerateMDILGlobalAnalysis" in file "Nutc" -- FAILED. 
Message Low Done building project "Nutc" -- FAILED. 
Message Low Compilation failed  

Вывод окна сборки

70>Project Performance Summary: 
70>       14 ms  F:\LAB\Fifi.APP.csproj   5 calls   
70>        1 ms  GetTargetFrameworks                        1 calls   
70>        3 ms  GetTargetPath                              1 calls   
70>        1 ms  GetNativeManifest                          1 calls   
70>        7 ms  GetCopyToOutputDirectoryItems              1 calls   
70>        2 ms  GetPackagingOutputs                        1 calls   
70>   856261 ms  F:\LAB\Fifi.APP.UWP.csproj                 1 calls  
70>   856261 ms  _GenerateAppxPackage                       1 calls  
70> 
70>Target Performance Summary:  
70>        0 ms  _SuppressDeploymentOnlyFeatures            1 calls 
70>        0 ms  _PopulateCommonStateForGetCopyToOutputDirectoryItems 2 calls 

70>     2442 ms  XamlPreCompile                             1 calls 
70>     4311 ms  ComputeNativePackageInputsAndOutputs       1 calls 
70>     4797 ms  ResolveAssemblyReferences                  1 calls 
70>   831183 ms  BuildNativePackage                         1 calls    
70> 
70>Task Performance Summary:    
70>        0 ms  FindAppConfigFile                          1 calls 
70>        0 ms  ResolveNonMSBuildProjectOutput             1 calls 

70>     4258 ms  ComputeManagedBinaries                     1 calls 
70>     4796 ms  ResolveAssemblyReference                   1 calls 
70>   831139 ms  LoggerBasedExecTask                        1 calls    
70> 
70>Build FAILED.    
70> 
70>"F:\LAB\Fifi.APP.UWP.csproj" (_GenerateAppxPackage target) (1) ->    
70>(BuildNativePackage target) ->   
70>  C:\Users\HHH\.nuget\packages\microsoft.net.native.compiler\2.2.8-rel-28605-00\tools\Microsoft.NetNative.targets(801,5): error : ILT0005: 'C:\Users\HHH\.nuget\packages\runtime.win10-x86.microsoft.net.native.compiler\2.2.8-rel-28605-00\tools\x86\ilc\Tools\nutc_driver.exe @"F:\LAB\Fifi.APP.UWP\obj\x86\Release\ilc\intermediate\MDIL\Fifi.APP.UWP.rsp"' returned exit code 1  
70> 
70>    0 Warning(s) 
70>    1 Error(s)   
70> 
70>Time Elapsed 00:14:15.65 
========== Build: 69 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========    
========== Package: 0 succeeded, 3 failed ===========  

3. Что я наделал Я проверил или попробовал все эти шаги, приведенные ниже, следуйте совету в stackoverflow или на веб-сайте, но не сработало:

  • Убедитесь, что только ASCII в пути и имени файла
  • Сделать убедитесь, что dotfuscator отсутствует
  • Переустановите инструменты Visual Studio и обновите
  • Убедитесь, что добавлен файл default.rd. xml
  • Создайте в той же системной учетной записи, что и кодирование
  • Обновить все пакеты NuGet
  • Попробовать в Visual Studio Enterprise 2019 preview Version 16.7.0 Preview 1.0 тоже не удалось
  • Удалить все анализаторы

4. Пакеты Nuget содержат Это решение имеет несколько проектов, эти пакеты nuget содержатся в одном или нескольких проектах:

 <PackageReference Include="System.Drawing.Common" Version="4.7.0"  />
 <PackageReference Include="Microsoft.Data.Sqlite" Version="3.1.4"  />
 <PackageReference Include="System.Data.SqlClient" Version="4.8.1" />
 <PackageReference Include="Newtonsoft.Json" Version="12.0.3"  />
 <PackageReference Include="Plugin.AudioRecorder" Version="1.1.0"  />
 <PackageReference Include="Plugin.MediaManager.Forms" Version="0.9.7"  />
 <PackageReference Include="Plugin.SpeechRecognition" Version="1.0.0"  />
 <PackageReference Include="Xam.Plugin.Media" Version="5.0.1"  />
 <PackageReference Include="Xamarin.Controls.SignaturePad.Forms" Version="3.0.0"  />
 <PackageReference Include="Xamarin.Essentials" Version="1.5.3.2"  />
 <PackageReference Include="Xamarin.Forms" Version="4.6.0.800"  />
 <PackageReference Include="Xamarin.Forms.InputKit" Version="3.3.0"  />
 <PackageReference Include="Xamarin.Plugin.FilePicker" Version="2.1.41"  />
 <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.10"  />

5. Третья библиотека, созданная с помощью инструментов соответствия эта библиотека находится в каталоге "\ obj \ x86 \ Release \ ilc \ in \" (сборки x64 и ARM все еще пусты, так как еще не обработаны):

2020/02/27  19:15            58,232 clrcompression.dll
2020/04/07  19:14           936,960 e_sqlite3.dll
2018/11/12  17:29            76,152 Microsoft.AspNetCore.Http.Abstractions.dll
2018/11/12  17:28            32,120 Microsoft.AspNetCore.Http.Features.dll
2018/11/12  17:40           103,800 Microsoft.AspNetCore.Mvc.Abstractions.dll
2018/11/12  17:38            41,040 Microsoft.AspNetCore.Routing.Abstractions.dll
2020/02/27  19:15           300,928 Microsoft.CSharp.dll
2020/04/15  16:49           149,584 Microsoft.Data.Sqlite.dll
2018/11/11  00:26            36,416 Microsoft.Extensions.Primitives.dll
2016/11/30  02:58         1,162,904 Microsoft.Graphics.Canvas.dll
2018/11/12  17:28            74,616 Microsoft.Net.Http.Headers.dll
2020/02/27  19:15           173,952 Microsoft.VisualBasic.dll
2020/02/27  19:15            19,328 Microsoft.Win32.Primitives.dll
2020/02/27  19:15            56,192 mscorlib.dll
2020/02/27  19:15            93,568 netstandard.dll
2019/11/09  00:56           693,680 Newtonsoft.Json.dll
2020/05/16  02:38            93,184 SQLite-net.dll
2020/05/01  14:35             5,120 SQLitePCLRaw.batteries_v2.dll
2020/05/01  14:35            46,592 SQLitePCLRaw.core.dll
2020/05/01  14:35            35,840 SQLitePCLRaw.provider.e_sqlite3.dll
2020/02/27  19:15            15,736 System.AppContext.dll
2020/02/27  19:15            15,744 System.Buffers.dll
2020/02/27  19:15            84,864 System.Collections.Concurrent.dll
2020/02/27  19:15           107,600 System.Collections.dll
2020/02/27  19:15           349,256 System.Collections.Immutable.dll
2020/02/27  19:15            48,208 System.Collections.NonGeneric.dll
2020/02/27  19:15            42,880 System.Collections.Specialized.dll
2020/02/27  19:15            75,344 System.ComponentModel.Annotations.dll
2020/02/27  19:15           265,600 System.ComponentModel.Composition.dll
2020/02/27  19:15            14,720 System.ComponentModel.DataAnnotations.dll
2020/02/27  19:15            15,224 System.ComponentModel.dll
2020/02/27  19:15            24,960 System.ComponentModel.EventBasedAsync.dll
2020/02/27  19:15            33,664 System.ComponentModel.Primitives.dll
2020/02/27  19:15           293,760 System.ComponentModel.TypeConverter.dll
2020/02/27  19:15            17,488 System.Configuration.dll
2020/02/27  19:15            82,296 System.Console.dll
2020/02/27  19:15            20,040 System.Core.dll
2020/02/27  19:15           959,872 System.Data.Common.dll
2020/02/27  19:15            22,400 System.Data.dll
2020/01/17  18:41           984,960 System.Data.SqlClient.dll
2020/02/27  19:15            16,464 System.Diagnostics.Contracts.dll
2020/02/27  19:15            16,464 System.Diagnostics.Debug.dll
2019/11/15  08:54            51,784 System.Diagnostics.DiagnosticSource.dll
2020/02/27  19:15            25,472 System.Diagnostics.FileVersionInfo.dll
2020/02/27  19:15           110,672 System.Diagnostics.Process.dll
2020/02/27  19:15            22,912 System.Diagnostics.StackTrace.dll
2020/02/27  19:15            22,096 System.Diagnostics.TextWriterTraceListener.dll
2020/02/27  19:15            16,456 System.Diagnostics.Tools.dll
2020/02/27  19:15            53,328 System.Diagnostics.TraceSource.dll
2020/02/27  19:15            24,960 System.Diagnostics.Tracing.dll
2020/02/27  19:15            49,024 System.dll
2018/09/18  19:38           143,408 System.Drawing.Common.dll
2020/02/27  19:15            18,296 System.Drawing.dll
2020/02/27  19:15            51,792 System.Drawing.Primitives.dll
2020/02/27  19:15            17,000 System.Dynamic.Runtime.dll
2020/02/27  19:15            16,464 System.Globalization.Calendars.dll
2020/02/27  19:15            16,464 System.Globalization.dll
2020/02/27  19:15            16,464 System.Globalization.Extensions.dll
2020/02/27  19:15           118,352 System.IO.Compression.dll
2020/02/27  19:15            13,392 System.IO.Compression.FileSystem.dll
2020/02/27  19:15            22,904 System.IO.Compression.ZipFile.dll
2020/02/27  19:15            16,464 System.IO.dll
2020/02/27  19:15           112,000 System.IO.FileSystem.dll
2020/02/27  19:15            43,392 System.IO.FileSystem.DriveInfo.dll
2020/02/27  19:15            15,952 System.IO.FileSystem.Primitives.dll
2020/02/27  19:15            41,336 System.IO.FileSystem.Watcher.dll
2020/02/27  19:15            41,344 System.IO.IsolatedStorage.dll
2020/02/27  19:15            46,464 System.IO.MemoryMappedFiles.dll
2020/02/27  19:15            19,024 System.IO.Pipes.AccessControl.dll
2020/02/27  19:15            73,088 System.IO.Pipes.dll
2020/02/27  19:15            66,432 System.IO.Ports.dll
2020/02/27  19:15            15,952 System.IO.UnmanagedMemoryStream.dll
2020/02/27  19:15           115,280 System.Linq.dll
2020/02/27  19:15           448,896 System.Linq.Expressions.dll
2020/02/27  19:15           217,704 System.Linq.Parallel.dll
2020/02/27  19:15            68,688 System.Linq.Queryable.dll
2020/02/27  19:15            94,592 System.Memory.dll
2020/02/27  19:15            15,736 System.Net.dll
2020/02/27  19:15           268,160 System.Net.Http.dll
2020/02/27  19:15            14,720 System.Net.Http.Rtc.dll
2020/02/27  19:15           155,520 System.Net.HttpListener.dll
2020/02/27  19:15           230,776 System.Net.Mail.dll
2020/02/27  19:15            61,816 System.Net.NameResolution.dll
2020/02/27  19:15           108,624 System.Net.NetworkInformation.dll
2020/02/27  19:15            50,560 System.Net.Ping.dll
2020/02/27  19:15           104,824 System.Net.Primitives.dll
2020/02/27  19:15           161,664 System.Net.Requests.dll
2020/02/27  19:15           231,808 System.Net.Security.dll
2020/02/27  19:15            24,960 System.Net.ServicePoint.dll
2020/02/27  19:15           209,488 System.Net.Sockets.dll
2020/02/27  19:15            73,088 System.Net.WebClient.dll
2020/02/27  19:15            48,512 System.Net.WebHeaderCollection.dll
2020/02/27  19:15            19,840 System.Net.WebProxy.dll
2020/02/27  19:15            61,312 System.Net.WebSockets.Client.dll
2020/02/27  19:15            61,000 System.Net.WebSockets.dll
2020/02/27  19:15            13,696 System.Numerics.dll
2020/02/27  19:15            69,200 System.Numerics.Vectors.dll
2020/02/27  19:15            15,952 System.Numerics.Vectors.WindowsRuntime.dll
2020/02/27  19:15            44,112 System.ObjectModel.dll
2020/02/27  19:15           719,232 System.Private.DataContractSerialization.dll
2020/02/27  19:15           467,832 System.Private.Reflection.Metadata.Ecma335.dll
2020/02/27  19:15         1,906,696 System.Private.ServiceModel.dll
2020/02/27  19:15            99,920 System.Private.Uri.dll
2020/02/27  19:15         2,702,712 System.Private.Xml.dll
2020/02/27  19:15           145,792 System.Private.Xml.Linq.dll
2020/02/27  19:15            17,280 System.Reflection.Context.dll
2020/02/27  19:15            15,744 System.Reflection.DispatchProxy.dll
2020/02/27  19:15            17,000 System.Reflection.dll
2020/02/27  19:15            16,256 System.Reflection.Emit.dll
2020/02/27  19:15            16,464 System.Reflection.Emit.ILGeneration.dll
2020/02/27  19:15            15,744 System.Reflection.Emit.Lightweight.dll
2020/02/27  19:15            15,744 System.Reflection.Extensions.dll
2020/02/27  19:15           570,752 System.Reflection.Metadata.dll
2020/02/27  19:15            16,256 System.Reflection.Primitives.dll
2020/02/27  19:15            22,912 System.Reflection.TypeExtensions.dll
2020/02/27  19:15            15,744 System.Resources.Reader.dll
2020/02/27  19:15            16,464 System.Resources.ResourceManager.dll
2020/02/27  19:15            26,696 System.Resources.Writer.dll
2019/11/15  08:37            16,968 System.Runtime.CompilerServices.Unsafe.dll
2020/02/27  19:15            16,256 System.Runtime.CompilerServices.VisualC.dll
2020/02/27  19:15            44,112 System.Runtime.dll
2020/02/27  19:15           169,040 System.Runtime.Extensions.dll
2020/02/27  19:15            16,488 System.Runtime.Handles.dll
2020/02/27  19:15            32,640 System.Runtime.InteropServices.dll
2020/02/27  19:15            22,608 System.Runtime.InteropServices.RuntimeInformation.dll
2020/02/27  19:15            19,024 System.Runtime.InteropServices.WindowsRuntime.dll
2020/02/27  19:15            73,088 System.Runtime.Numerics.dll
2020/02/27  19:15            14,720 System.Runtime.Serialization.dll
2020/02/27  19:15           128,896 System.Runtime.Serialization.Formatters.dll
2020/02/27  19:15            16,464 System.Runtime.Serialization.Json.dll
2020/02/27  19:15            22,608 System.Runtime.Serialization.Primitives.dll
2020/02/27  19:15            16,976 System.Runtime.Serialization.Xml.dll
2020/02/27  19:15           109,944 System.Runtime.WindowsRuntime.dll
2020/02/27  19:15            40,016 System.Runtime.WindowsRuntime.UI.Xaml.dll
2020/02/27  19:15            98,176 System.Security.AccessControl.dll
2020/02/27  19:15            50,768 System.Security.Claims.dll
2020/02/27  19:15           158,792 System.Security.Cryptography.Algorithms.dll
2020/02/27  19:15           121,208 System.Security.Cryptography.Cng.dll
2020/02/27  19:15            84,352 System.Security.Cryptography.Csp.dll
2020/02/27  19:15            46,976 System.Security.Cryptography.Encoding.dll
2020/02/27  19:15            48,000 System.Security.Cryptography.Primitives.dll
2020/02/27  19:15           185,216 System.Security.Cryptography.X509Certificates.dll
2020/02/27  19:15            15,744 System.Security.dll
2020/02/27  19:15            89,472 System.Security.Permissions.dll
2020/02/27  19:15            15,440 System.Security.Principal.dll
2020/02/27  19:15            76,160 System.Security.Principal.Windows.dll
2020/02/27  19:15            15,744 System.Security.SecureString.dll
2020/02/27  19:15            30,728 System.ServiceModel.dll
2020/02/27  19:15            24,072 System.ServiceModel.Duplex.dll
2020/02/27  19:15            23,672 System.ServiceModel.Http.dll
2020/02/27  19:15            24,584 System.ServiceModel.NetTcp.dll
2020/02/27  19:15            29,736 System.ServiceModel.Primitives.dll
2020/02/27  19:15            23,160 System.ServiceModel.Security.dll
2020/02/27  19:15            14,720 System.ServiceModel.Web.dll
2020/02/27  19:15            14,200 System.ServiceProcess.dll
2019/11/15  08:53           755,576 System.Text.Encoding.CodePages.dll
2020/02/27  19:15            16,456 System.Text.Encoding.dll
2020/02/27  19:15            15,744 System.Text.Encoding.Extensions.dll
2018/05/15  13:29            61,072 System.Text.Encodings.Web.dll
2020/02/27  19:15           121,424 System.Text.RegularExpressions.dll
2020/02/27  19:15            56,192 System.Threading.dll
2020/02/27  19:15            19,536 System.Threading.Overlapped.dll
2020/02/27  19:15           168,528 System.Threading.Tasks.Dataflow.dll
2020/02/27  19:15            16,760 System.Threading.Tasks.dll
2020/02/27  19:15            16,256 System.Threading.Tasks.Extensions.dll
2020/02/27  19:15            52,304 System.Threading.Tasks.Parallel.dll
2020/02/27  19:15            29,568 System.Threading.Thread.dll
2020/02/27  19:15            15,744 System.Threading.ThreadPool.dll
2020/02/27  19:15            15,952 System.Threading.Timer.dll
2020/02/27  19:15            14,712 System.Transactions.dll
2020/02/27  19:15           170,360 System.Transactions.Local.dll
2020/02/27  19:15            18,296 System.ValueTuple.dll
2020/02/27  19:15            13,392 System.Web.dll
2020/02/27  19:15            24,448 System.Web.HttpUtility.dll
2020/02/27  19:15            13,696 System.Windows.dll
2020/02/27  19:15            21,880 System.Xml.dll
2020/02/27  19:15            14,440 System.Xml.Linq.dll
2020/02/27  19:15            22,096 System.Xml.ReaderWriter.dll
2020/02/27  19:15            14,416 System.Xml.Serialization.dll
2020/02/27  19:15            16,256 System.Xml.XDocument.dll
2020/02/27  19:15            16,976 System.Xml.XmlDocument.dll
2020/02/27  19:15            18,304 System.Xml.XmlSerializer.dll
2020/02/27  19:15            16,464 System.Xml.XPath.dll
2020/02/27  19:15            16,976 System.Xml.XPath.XDocument.dll
2020/02/27  19:15            14,208 WindowsBase.dll
2020/05/12  00:41           138,872 Xamarin.Essentials.dll
2020/05/16  20:12         1,103,992 Xamarin.Forms.Core.dll
2020/05/16  20:12            13,952 Xamarin.Forms.Platform.dll
2020/05/16  20:12           535,176 Xamarin.Forms.Platform.UAP.dll
2020/05/16  20:12           112,248 Xamarin.Forms.Xaml.dll

Кто-нибудь, пожалуйста, помогите мне. Большое спасибо!

1 Ответ

0 голосов
/ 08 июня 2020

Наконец, я решил эту проблему частично, отключив отражение и сериализацию. На выполнение требований требуется больше 10 минут каждый раз. Я делюсь своими шагами здесь.

  1. Я достиг на Компиляция приложений с. NET Native , это действительно полезно. Я проверил или изменил код, чтобы убедиться:

    • Удалить двоичный файл / XML сериализовать, заменить пользователем, определить сериализовать
    • Нет Dynami c создание многомерных массивов
    • No Dynami c type
    • Удалить потенциальное бесконечное расширение generi c типа, например:

    publi c абстрактный класс LoadRangeBase: IDataLoadRange, где TLoadLange: LoadRangeBase, new ()

Но выполнить все равно не удалось.

2. Выполнить на другом компьютере с памятью 24 ГБ, но все равно не удалось. Компилятор может быть 32-битным, больше памяти бесполезно

3. Разделение на ДВА решения. Каждое решение соответствует УСПЕШНО. Я действительно поражен. Таким образом, сбой сборки определенно НЕ вызван расширением типа Infinite generi c, сбой сборки не вызван кодом. Во время проверки я обнаружил, что каждое решение занимает более 2 ГБ памяти, а размер файла Reflectionlog.csv составляет более 900 МБ. Мой код является базой системы типов на общих c классах абстракции, я предполагаю, что у него действительно не хватает памяти для дополнительной памяти, необходимой для обработки отражения и сериализации. Итак. NET Встроенная цепочка инструментов, возможно, должна быть обновлена ​​до 64-битной.

4. Попытайтесь уменьшить использование памяти

  • удалить ненужные или не направленные пакеты или проекты NuGet, на которые имеются ссылки
  • Измените rd. xml в соответствии с Директивами времени выполнения (rd. xml) Ссылка на файл конфигурации , удалите <Assembly Name="*Application*" Dynamic="Required All" /> и добавьте <Namespace Name="YourNamespace" Dynamic="Excluded" Serialize="Excluded" />, чтобы избежать отражения и сериализации. Сборка прошла успешно, и размер файла msix обычно уменьшился на 5-6M.

Наконец, я предлагаю обратить внимание на тип generi c в UWP.

...