pamidur / aspect-injector

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

Aspect Injector processing has failed (v2.8.0), Mono.Cecil.Cil.SymbolsNotFoundException #200

Closed minchili closed 1 year ago

minchili commented 1 year ago

Environment (please complete the following information):

OS: Windows 10 64 bit Framework: .Net Framework 4.7.2, C# 8.0 Type of application: dll / Console Version of AspectInjector: 2.8.0

Describe the bug

When I create the project and install Aspect Injector and then build I get the following error: (The project has not even written any code, it is just a simple build.)

Error1: Aspect Injector processing has failed. See other errors. Error2: Processing failure: Mono.Cecil.Cil.SymbolsNotFoundException: No symbol found for file: C:\Users**\Repositories\Samples\AOP\ClassLibrary1\obj\Debug\ClassLibrary1.dll

pamidur commented 1 year ago

Hi @minchili , thank you for the report, I'll look at it shortly. Is there any chance you could send the project as zip?

minchili commented 1 year ago

ClassLibrary1.zip Thanks for the reply, here is the project where the error occurred.

pamidur commented 1 year ago

What IDE you use? I didn't manage to reproduce it on VS2022

minchili commented 1 year ago

I use VS2022 too, this is my IDE info. IDE Info.txt

leandrogomes777 commented 1 year ago

Hi, we've have the same issue here.

We have a workaround to compile. Set the DebugType on your csproj to portable (instead of full or pdbonly). Ex: <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <DebugType>portable</DebugType>

@pamidur could you address this issue? We have to maintain the configuration of pdb to "full" here.

pamidur commented 1 year ago

@leandrogomes777 thank you for the input. It is definitely an issue with PDB type and Mono.Cecil

pamidur commented 1 year ago

@leandrogomes777 @minchili could you please check if 2.7.2 and 2.7.1 have the same issue?

leandrogomes777 commented 1 year ago

Hi @pamidur, i've made tests with the 2.7.2 version and no issues.

pamidur commented 1 year ago

Ok so I found a root cause - over-optimization while compiling for self-contained image Should be fixed in 2.8.1

Thank you @leandrogomes777 , @minchili