dotnet / linker

387 stars 134 forks source link

Error IL1012: Fatal error in IL Linker, Unhandled exception. System.NotImplementedException: Unhandled intrinsic #3218

Open jlchavez opened 1 year ago

jlchavez commented 1 year ago

Following instructions: SDK: .NET 7.0.201 Visual Studio 2022 17.5.1 Publishing a project with .NET 7, .NET Standard 2.1 and Blazor WASM

07:51:35:266 ILLink(0,0): Error IL1012: IL Trimmer has encountered an unexpected error. Please report the issue at https://github.com/dotnet/linker/issues 07:51:35:319 Fatal error in IL Linker 07:51:35:319 Unhandled exception. System.NotImplementedException: Unhandled intrinsic 07:51:35:319 at Mono.Linker.Dataflow.ReflectionMethodBodyScanner.HandleCall(Instruction operation, MethodReference calledMethod, ValueSet1 instanceValue, ImmutableArray1 argumentValues, DiagnosticContext diagnosticContext, ReflectionMarker reflectionMarker, LinkContext context, MarkStep markStep, ValueSet1& methodReturnValue) 07:51:35:319 at Mono.Linker.Dataflow.ReflectionMethodBodyScanner.HandleCall(MethodBody callingMethodBody, MethodReference calledMethod, Instruction operation, ValueNodeList methodParams, ValueSet1& methodReturnValue) 07:51:35:319 at Mono.Linker.Dataflow.MethodBodyScanner.HandleCall(MethodBody callingMethodBody, Instruction operation, Stack1 currentStack, Dictionary2 locals, InterproceduralState& interproceduralState, Int32 curBasicBlock) 07:51:35:319 at Mono.Linker.Dataflow.MethodBodyScanner.Scan(MethodBody methodBody, InterproceduralState& interproceduralState) 07:51:35:319 at Mono.Linker.Dataflow.ReflectionMethodBodyScanner.Scan(MethodBody methodBody, InterproceduralState& interproceduralState) 07:51:35:319 at Mono.Linker.Dataflow.MethodBodyScanner.InterproceduralScan(MethodBody startingMethodBody) 07:51:35:319 at Mono.Linker.Dataflow.ReflectionMethodBodyScanner.InterproceduralScan(MethodBody methodBody) 07:51:35:319 at Mono.Linker.Steps.MarkStep.MarkReflectionLikeDependencies(MethodBody body, Boolean requiresReflectionMethodBodyScanner) 07:51:35:319 at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body) 07:51:35:319 at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method, DependencyInfo& reason, MessageOrigin& origin) 07:51:35:319 at Mono.Linker.Steps.MarkStep.ProcessQueue() 07:51:35:319 at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue() 07:51:35:319 at Mono.Linker.Steps.MarkStep.Process() 07:51:35:319 at Mono.Linker.Steps.MarkStep.Process(LinkContext context) 07:51:35:319 at Mono.Linker.Pipeline.Process(LinkContext context) 07:51:35:319 at Mono.Linker.Driver.Run(ILogger customLogger) 07:51:35:319 at Mono.Linker.Driver.Main(String[] args) 07:51:39:577 C:\Program Files\dotnet\sdk\7.0.201\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. 07:51:39:577
07:51:39:578 32>Build failed. Check the Output window for more details. 07:51:39:774 ========== Build: 31 succeeded, 0 failed, 69 up-to-date, 0 skipped ========== 07:51:39:774 ========== Build started at 7:48 AM and took 03:31.081 minutes ========== 07:51:39:777 ========== Publish: 0 succeeded, 1 failed, 0 skipped ========== 07:51:39:777 ========== Publish started at 7:48 AM and took 03:31.084 minutes ==========

vitek-karas commented 1 year ago

This looks very similar to https://github.com/dotnet/linker/issues/3072. That issue has been fixed in more recent release than the one you're using. Could you please try to upgrade to the latest .NET 7 SDK (currently 7.0.302)?