error AI_ERR0: Processing failure: System.Exception: Cannot resolve generic parameter

See original GitHub issue

Exception Message

29>  AspectInjector: Found 0 aspects, 262 injections
29>AspectInjector : error AI_ERR0: Processing failure: System.Exception: Cannot resolve generic parameter
29>     at FluentIL.Extensions.GenericProcessingExtension.ResolveGenericType(MemberReference member, TypeReference param)
29>     at System.Linq.Enumerable.SelectIListIterator`2.ToArray()
29>     at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
29>     at FluentIL.Extensions.GenericProcessingExtension.ParametrizeGenericInstance(MemberReference member, GenericInstanceType generic)
29>     at FluentIL.Extensions.GenericProcessingExtension.MakeCallReference(MemberReference member, FieldReference reference)
29>     at FluentIL.TypeMembers.Load(Cut cut, FieldReference field)
29>     at AspectInjector.Core.Extensions.FluentExtensions.LoadAspect(Cut cut, AspectDefinition aspect, MethodDefinition method, PointCut accessor)
29>     at AspectInjector.Core.Extensions.FluentExtensions.LoadAspect(Cut cut, AspectDefinition aspect)
29>     at AspectInjector.Core.Advice.Weavers.Processes.AdviceAroundProcess.<Execute>b__5_0(Cut e)
29>     at FluentIL.Cut.Here(PointCut pc)
29>     at FluentIL.MethodEditor.Instead(MethodBody body, PointCut action)
29>     at AspectInjector.Core.Processor.PatchAssembly(AssemblyDefinition assembly, Boolean optimize, Boolean verbose)
29>     at FluentIL.PatcherBase.Process(String assemblyFile, IAssemblyResolver resolver, Boolean optimize, Boolean verbose)
29>     at AspectInjector.Compiler.Execute(String filename, IReadOnlyList`1 references, Boolean optimize, Boolean verbose). Please submit an issue to https://github.com/pamidur/aspect-injector
29>AspectInjector : error AI_FAIL: Aspect Injector processing has failed. See other errors.

Code

namespace VM.ViewModels.Base
{
    using VM.Managed;
    using VM.ViewModels.Attributes;
    using VM.ViewModels.Pre;

    public class VariableViewModel : ExpressionViewModel<Variable>
    {
        public VariableViewModel(Identifier id, IDocumentViewModel parentDocument)
            : base(id, parentDocument)
        {
        }

        [AspectAttribute(nameof(Source))]
        public double Value { get; set; }
    }
}

Generic parameters are not used. However, the above error occurs.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
pamidurcommented, Jul 11, 2019

Hi, Wow, this is new generic-related bug. I thought they were fixed long ago. Thanks for the report. I’ll be looking at it soon.

0reactions
ColmBhandalcommented, Jan 19, 2020

Thanks!

On Sat, 18 Jan 2020, 22:22 Oleksandr Hulyi, notifications@github.com wrote:

Fixed in https://github.com/pamidur/aspect-injector/releases/tag/2.2.7 @ColmBhandal https://github.com/ColmBhandal you should be able to use Scope PerInstance now Sorry for such a long delay, the issue drills down to how (not obvious) mono.cecil works sometimes.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pamidur/aspect-injector/issues/97?email_source=notifications&email_token=ADMQGKLQ3ZLWGYOCM7NHV7LQ6N6LJA5CNFSM4IAOF4NKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJKDIBQ#issuecomment-575943686, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADMQGKK3DS5YNC4XQ7P275DQ6N6LJANCNFSM4IAOF4NA .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Java - generic parameter can't be resolved
I'm writing a generic Dao interface and I have encountered some problems. I have the following generic Entity interface public interface Entity< ...
Read more >
IL2CPP error on a struct generic method with a in ...
System.Exception: Failed to resolve type reference at Unity.Cecil.Awesome.TypeReferenceExtensions.IsEnum(TypeReference type) at Unity.
Read more >
Compiler Error CS0308
The non-generic type-or-method 'identifier' cannot be used with type arguments. The method or type is not generic, but it was used with type ......
Read more >
Restrictions on Generics (The Java™ Tutorials ...
Cannot Instantiate Generic Types with Primitive Types; Cannot Create Instances of Type Parameters; Cannot Declare Static Fields Whose Types are Type ...
Read more >
c# - In a generic method, what exception should I throw ...
In my method, any object is acceptable as an argument (so no problem there), but only specific types are acceptable for the type...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found