dotnet / linker

387 stars 126 forks source link

ILLink : error IL1012: IL Trimmer has encountered an unexpected error. #3183

Open Kotnstantin opened 1 year ago

Kotnstantin commented 1 year ago

In my CI/CD server Teamcity begin fail with error ILLink : error IL1012: How solve it? .NET SDK 7.0.101

[dotnet publish] Soy.ESUV.Api -> C:\BuildAgent\work\5cd2fd8ab5008a79\Soy.ESUV.Api\bin\Debug\net6.0\Soy.ESUV.Api.dll Optimizing assemblies for size may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink Optimizing assemblies for size. This process might take a while. ILLink : error IL1012: IL Trimmer has encountered an unexpected error. Please report the issue at https://github.com/dotnet/linker/issues Fatal error in IL Linker Out of memory. C:\Program Files\dotnet\sdk\7.0.101\Sdks\Microsoft.NET.ILLink.Tasks\build\Microsoft.NET.ILLink.targets(86,5): error NETSDK1144: Optimizing assemblies for size failed. Optimization can be disabled by setting the PublishTrimmed property to false.

Internal error message details: BuildMessage1 0 Text DefaultMessage ERROR 1810543934496900 tags:'tc:parseServiceMessagesInside' Error message is logged Build FAILED.

vitek-karas commented 1 year ago

Could you please try the steps described in https://github.com/dotnet/linker/issues/3160 and see if it helps. It's not a solution, just trying if the latest fixes will make it work for you.