pamidur / aspect-injector

AOP framework for .NET (c#, vb, etc)
Apache License 2.0
772 stars 115 forks source link

AspectInjector|2.8.1 : error AI_ERR0: Processing failure: System.NotSupportedException: Arg_NotSupportedException #228

Closed tuanhle94 closed 1 week ago

tuanhle94 commented 7 months ago

Environment (please complete the following information):

Describe the bug

AspectInjector|2.8.1 : error AI_ERR0: Processing failure: System.NotSupportedException: Arg_NotSupportedException

 at Mono.Cecil.MetadataBuilder.AddLocalScope(MethodDebugInformation method_info, ScopeDebugInformation scope)
 at Mono.Cecil.MetadataBuilder.AddMethodDebugInformation(MethodDebugInformation method_info)
 at Mono.Cecil.Cil.PortablePdbWriter.Write(MethodDebugInformation info)
 at Mono.Cecil.Cil.CodeWriter.WriteResolvedMethodBody(MethodDefinition method)
 at Mono.Cecil.Cil.CodeWriter.WriteMethodBody(MethodDefinition method)
 at Mono.Cecil.MetadataBuilder.AddMethod(MethodDefinition method)
 at Mono.Cecil.MetadataBuilder.AddMethods(TypeDefinition type)
 at Mono.Cecil.MetadataBuilder.AddType(TypeDefinition type)
 at Mono.Cecil.MetadataBuilder.AddTypes()
 at Mono.Cecil.MetadataBuilder.BuildTypes()
 at Mono.Cecil.MetadataBuilder.BuildModule()
 at Mono.Cecil.MetadataBuilder.BuildMetadata()
 at Mono.Cecil.ModuleWriter.<>c.<BuildMetadata>b__2_0(MetadataBuilder builder, MetadataReader _)
 at Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TItem item, Func`3 read)
 at Mono.Cecil.ModuleWriter.BuildMetadata(ModuleDefinition module, MetadataBuilder metadata)
 at Mono.Cecil.ModuleWriter.Write(ModuleDefinition module, Disposable`1 stream, WriterParameters parameters)
 at Mono.Cecil.ModuleWriter.WriteModule(ModuleDefinition module, Disposable`1 stream, WriterParameters parameters)
 at Mono.Cecil.ModuleDefinition.Write(Stream stream, WriterParameters parameters)
 at Mono.Cecil.ModuleDefinition.Write(WriterParameters parameters)
 at Mono.Cecil.AssemblyDefinition.Write(WriterParameters parameters)
 at FluentIL.PatcherBase.WriteAssembly(AssemblyDefinition assembly, Boolean writeSymbols, Boolean verbose)
 at FluentIL.PatcherBase.Process(String assemblyFile, IAssemblyResolver resolver, Boolean optimize, Boolean verbose)
 at FluentIL.PatcherBase.Process(String assemblyFile, IReadOnlyList`1 references, Boolean optimize, Boolean verbose)
 at AspectInjector.Compiler.Execute(String filename, IReadOnlyList`1 references, Boolean optimize, Boolean verbose). Please submit an issue to https://github.com/pamidur/aspect-injector

AspectInjector : error AI_FAIL: Aspect Injector processing has failed. See other errors.

To Reproduce This happens when I run dotnet publish. Running dotnet build works fine. My REST API is using Amazon API Gateway service. I'm not sure how to debug this issue since these error messages do not show where the error occurs in my code specifically.