Code Monkey home page Code Monkey logo

Comments (5)

pamidur avatar pamidur commented on August 16, 2024

Thanks for the report. We'll take a look shortly. Meanwhile could you please cleanup your solution and try again please? It seems like not aspect-inject related issue, if it was it would rather load and fail in runtime.

from aspect-injector.

pamidur avatar pamidur commented on August 16, 2024

@workerclass, not needed to re-check. The bug is there.

from aspect-injector.

workerclass avatar workerclass commented on August 16, 2024

A slightly different code gives a less cryptic exception: "Unhandled Exception: System.InvalidOperationException: Could not execute the method because either the method itself or the containing type is not fully instantiated."

using AspectInjector.Broker;
using System;

namespace ReproduceBug
{
    class Program
    {
        class EmptyAspect
        {
            [Advice(InjectionPoints.Around, InjectionTargets.Method)]
            public object GetResult(
            [AdviceArgument(AdviceArgumentSource.Target)] Func<object[], object> target,
            [AdviceArgument(AdviceArgumentSource.Arguments)] object[] args)
            {
                return target.Invoke(args);
            }
        }

        [Aspect(typeof(EmptyAspect))]
        class Bug<T>
        {
            public string Execute(T input)
            {
                return input.ToString();
            }
        }

        static void Main(string[] args)
        {
            var bug = new Bug<int>();
            bug.Execute(0);
        }
    }
}

from aspect-injector.

pamidur avatar pamidur commented on August 16, 2024

It's definitely a bug of generic type import. We'll address it soon.

from aspect-injector.

pamidur avatar pamidur commented on August 16, 2024

fixed in https://github.com/pamidur/aspect-injector/releases/tag/1.0.0-rc1

from aspect-injector.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.