Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsupported language/version ? #214

Open
manson opened this issue Apr 10, 2023 · 1 comment
Open

Unsupported language/version ? #214

manson opened this issue Apr 10, 2023 · 1 comment
Labels

Comments

@manson
Copy link

manson commented Apr 10, 2023

Environment:

  • OS: windows10
  • Framework: 4.6.2
  • Type of application: asp.net, class library
  • Version of AspectInjector: 2.8.1, 2.8.2-pre

I have an ASP.NET big application with multiple sub projects (libraries). I have implemented a separate library Tracing with all aspects and attributes implementation. Next I have added reference to this project from main app and started testing, It worked well until I have finished the needed logic and applied attributes to all the classes I need to intercept behavior with AspectInjector. And after spending the whole day doing this, I got next error on building my app.

7>AspectInjector|2.8.1 : error AI_ERR0: Processing failure: System.InvalidOperationException: Expected sequence is not found even once. Unsupported language/version ?
7>     at FluentIL.MethodEditor.OnEveryOccasionOf(MethodBody body, Func`2 predicate, PointCut pc, Instruction startingFrom)
7>     at FluentIL.MethodEditor.OnCall(MethodBody body, MethodReference method, PointCut pc, Instruction startingFrom)
7>     at AspectInjector.Core.Advice.Weavers.Processes.AfterAsyncWeaveProcess.FindOrCreateAfterStateMachineMethod()
7>     at AspectInjector.Core.Advice.Weavers.Processes.AfterStateMachineWeaveProcessBase.Execute()
7>     at AspectInjector.Core.Advice.Weavers.AdviceStateMachineWeaver.WeaveMethod(MethodDefinition method, InjectionDefinition injection)
7>     at AspectInjector.Core.Advice.Weavers.AdviceInlineWeaver.Weave(InjectionDefinition injection)
7>     at AspectInjector.Core.Processor.PatchAssembly(AssemblyDefinition assembly, Boolean optimize, Boolean verbose)
7>     at FluentIL.PatcherBase.Process(String assemblyFile, IAssemblyResolver resolver, Boolean optimize, Boolean verbose)
7>     at FluentIL.PatcherBase.Process(String assemblyFile, IReadOnlyList`1 references, Boolean optimize, Boolean verbose)
7>     at AspectInjector.Compiler.Execute(String filename, IReadOnlyList`1 references, Boolean optimize, Boolean verbose). Please submit an issue to https://github.com/pamidur/aspect-injector
7>AspectInjector : error AI_FAIL: Aspect Injector processing has failed. See other errors.

The same for 2.8.2

7>AspectInjector|2.8.2 : error AI_ERR0: Processing failure: System.InvalidOperationException: Expected sequence is not found even once. Unsupported language/version ?
7>     at FluentIL.MethodEditor.OnEveryOccasionOf(MethodBody body, Func`2 predicate, PointCut pc, Instruction startingFrom)
7>     at FluentIL.MethodEditor.OnCall(MethodBody body, MethodReference method, PointCut pc, Instruction startingFrom)
7>     at AspectInjector.Core.Advice.Weavers.Processes.AfterAsyncWeaveProcess.FindOrCreateAfterStateMachineMethod()
7>     at AspectInjector.Core.Advice.Weavers.Processes.AfterStateMachineWeaveProcessBase.Execute()
7>     at AspectInjector.Core.Advice.Weavers.AdviceStateMachineWeaver.WeaveMethod(MethodDefinition method, InjectionDefinition injection)
7>     at AspectInjector.Core.Advice.Weavers.AdviceInlineWeaver.Weave(InjectionDefinition injection)
7>     at AspectInjector.Core.Processor.PatchAssembly(AssemblyDefinition assembly, Boolean optimize, Boolean verbose)
7>     at FluentIL.PatcherBase.Process(String assemblyFile, IAssemblyResolver resolver, Boolean optimize, Boolean verbose)
7>     at FluentIL.PatcherBase.Process(String assemblyFile, IReadOnlyList`1 references, Boolean optimize, Boolean verbose)
7>     at AspectInjector.Compiler.Execute(String filename, IReadOnlyList`1 references, Boolean optimize, Boolean verbose). Please submit an issue to https://github.com/pamidur/aspect-injector
7>AspectInjector : error AI_FAIL: Aspect Injector processing has failed. See other errors.

Don't know even what to think.

UPD.
I don't know what happened (I spent a day finding error reason) but everything has fixed after I have added the new subproject (class library) into the solution for testing, applied attributes to it, built. It built ok, but after I checked the main project and it built as well! Now everything works well - I cleanup solution, rebuild and it works... Don't know what to think. Hope later it wont face the same issue...

UPD
No, it do not work. It just reference to aspect library in this project dropped and hence was not doing any injection and so build without errors....

UPD
Figured out where this happened, but not why. This is an ordinary class where putting attributes on it raising that error. I have about 30 classes with this aspect attributes and similar classes and only on this class it breaks. Cannot get how it differ from others. Temporarilly removed attributes from this class, let it be unwachable for a while. If you have any ideas whould be greatfull...

@manson manson added the bug label Apr 10, 2023
@pamidur
Copy link
Owner

pamidur commented Jun 7, 2023

Hey @manson , thatnk you for the report and sorry for the delay. Would it be possible to share the code of the affected classs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants