pamidur / aspect-injector

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

.Net Framework 4.7.2 builds failing on latest Nuget package version 2.7.1 #176

Closed Meigs2 closed 2 years ago

Meigs2 commented 2 years ago

Building a .Net Framework 4.7.2 app on 2.7.1 fails on the latest nuget package version with the following output:

1>  AspectInjector|2.7.1: Found 1 aspects, 0 injections
1>AspectInjector|2.7.1 : error AI_ERR0: Processing failure: System.TypeLoadException
1>     at Mono.Cecil.Pdb.SymWriter.CoCreateInstance(Guid& rclsid, Object pUnkOuter, UInt32 dwClsContext, Guid& riid, Object& ppv)
1>     at Mono.Cecil.Pdb.SymWriter..ctor()
1>     at Mono.Cecil.Pdb.NativePdbWriterProvider.CreateWriter(ModuleDefinition module, String pdb)
1>     at Mono.Cecil.Pdb.NativePdbWriterProvider.GetSymbolWriter(ModuleDefinition module, String fileName)
1>     at Mono.Cecil.Cil.DefaultSymbolWriterProvider.GetSymbolWriter(ModuleDefinition module, String fileName)
1>     at Mono.Cecil.ModuleWriter.GetSymbolWriter(ModuleDefinition module, String fq_name, ISymbolWriterProvider symbol_writer_provider, WriterParameters parameters)
1>     at Mono.Cecil.ModuleWriter.Write(ModuleDefinition module, Disposable`1 stream, WriterParameters parameters)
1>     at Mono.Cecil.ModuleWriter.WriteModule(ModuleDefinition module, Disposable`1 stream, WriterParameters parameters)
1>     at Mono.Cecil.ModuleDefinition.Write(Stream stream, WriterParameters parameters)
1>     at Mono.Cecil.ModuleDefinition.Write(WriterParameters parameters)
1>     at Mono.Cecil.AssemblyDefinition.Write(WriterParameters parameters)
1>     at FluentIL.PatcherBase.WriteAssembly(AssemblyDefinition assembly, Boolean writeSymbols, Boolean verbose)
1>     at FluentIL.PatcherBase.Process(String assemblyFile, IAssemblyResolver resolver, Boolean optimize, Boolean verbose)
1>     at FluentIL.PatcherBase.Process(String assemblyFile, IReadOnlyList`1 references, Boolean optimize, Boolean verbose)
1>     at AspectInjector.Compiler.Execute(String filename, IReadOnlyList`1 references, Boolean optimize, Boolean verbose). Please submit an issue to https://github.com/pamidur/aspect-injector
1>AspectInjector : error AI_FAIL: Aspect Injector processing has failed. See other errors.

Same project does not fail on 2.6.1.

pamidur commented 2 years ago

@Meigs2 , could you please provide a sample project where this happens? I could not reproduce it locally

pamidur commented 2 years ago

Alright, I got it. Trimming executable has disabled COM support needed for native PDBs what you use by default with old-style csproj files on windows.

pamidur commented 2 years ago

should be fixed 2.7.2