Coder Social home page Coder Social logo

mradvice's Introduction

Mr. Advice

Summary

Mr. Advice is an open source (and free of charge) alternative to PostSharp (which is still far more advanced, see https://www.postsharp.net).
It intends to inject aspects at build-time. Advices are written in the form of attributes, and marking methods with them makes the pointcut, resulting in a nice and easy aspect injection.
More information about what is an aspect at Wikipedia.

Mr. Advice can weave assemblies for:

  • .NET framework ≥4.6.1 / Mono
  • .NET ≥5
  • .NET Standard 2.0

Mr. Advice allows you to:

  • Advise methods or parameters, at assembly, type, method or parameter level
  • Advice types (at assembly startup)
  • Introduce fields
  • Advise Mr. Advice (and this is BIG) at weaving-time (during build step), so you can rename methods as they are advised, add properties, etc.

How it works

It is available as a NuGet Status package. There is also an automatic build with tests at appveyor. The current status is Build status

Philosophy

Currently, MrAdvice won't bring you any aspect out-of-the-box. This means you'll have to write your own aspects (however you can see below other packages using Mr. Advice).
So it brings us to the next chapter, which is...

How to implement your own aspects

In a nutshell

Here is the minimal sample:

public class MyProudAdvice : Attribute, IMethodAdvice
{
    public void Advise(MethodAdviceContext context)
    {
        // do things you want here
        context.Proceed(); // this calls the original method
        // do other things here
    }
}

You then just need to mark the method(s) with the attribute and that's it, your aspect is injected!

[MyProudAdvice]
public void MyProudMethod()
{
}

More details

Your aspects can be injected at assembly, type or method level, simply by setting the attribute:

  • When an aspect is injected at asembly level, all methods of all types are weaved.
  • When the aspect is injected at type level, all of its methods are weaved.
  • And of course, if the aspect is injected on a method, only the method is weaved.

Other projects using Mr. Advice

NuGet packages:

Miscellaneous projects:

Contact and links

Project owner is picrap, feel free to drop a mail 📧.
Project company is Arx One, a french company editor of backup software solutions.

mradvice's People

Contributors

jorgenbosman avatar mwoelk83 avatar pankajrawat333 avatar picrap avatar rgroenewoudt avatar simoncropp avatar soroshsabz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mradvice's Issues

initlocals must be set for verifiable

Error 1 Fody: PEVerify of the assembly failed.

[IL]: Error: [C:\Code\Fody\FodyAddinSamples\MrAdviceSample\bin\Debug\MrAdviceSample.dll : MrAdviceSample::MyMethodWithAdvice][offset 0x00000008] 
initlocals must be set for verifiable methods with one or more local variables.
1 Error(s) Verifying C:\Code\Fody\FodyAddinSamples\MrAdviceSample\bin\Debug\MrAdviceSample.dll
    MrAdviceSample

Parallel weaving

Make methods weaving parallel (see if we can gain some performance here)

Unable to weave class with multiple indexers

Example code:

    [MyAdvice]
    class Foo
    {
        public object this[string bar]
        {
            get { return new object(); }
        }

        public object this[int bar]
        {
            get { return new object(); }
        }
    }

Gives error:

Error 1 Fody/MrAdvice.Weaver: Error while weaving method 'System.Object MrAdviceBug.Foo::get_Item(System.Int32)': System.InvalidOperationException: Sequence contains more than one matching element
at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
at ArxOne.MrAdvice.Reflection.Groups.MethodReflectionNode.LoadParent()
at ArxOne.MrAdvice.Reflection.Groups.ReflectionNode.<GetSelfAndAncestors>d__14.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.<ReverseIterator>d__a0`1.MoveNext()
at System.Linq.Enumerable.<ConcatIterator>d__71`1.MoveNext()
at System.Linq.Enumerable.<SelectManyIterator>d__14`2.MoveNext()
at System.Linq.Enumerable.<DistinctIterator>d__81`1.MoveNext()
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at ArxOne.MrAdvice.Weaver.AspectWeaver.WeaveIntroductions(MethodDefinition method, TypeDefinition adviceInterface, ModuleDefinition moduleDefinition, Types types)
at ArxOne.MrAdvice.Weaver.AspectWeaver.WeaveMethod(ModuleDefinition moduleDefinition, MarkedNode markedMethod, TypeDefinition adviceInterface, Types types) MrAdviceBug

Handle properties

Currently, properties can be handled as methods.
We may need to setup a new interface to handle properties properly.

Problem with constructor with 8 parameters.

Hi,

I received following error when i tried compile my project.
It happens because constructor of some class has more than 8 parameters.

Error 11 Fody/MrAdvice.Weaver: Error while weaving method 'System.Void Mpos.Modules.Selling.ViewModels.ShoppingCart.ShoppingCartViewModel::.ctor(Mpos.Shared.Services.Contracts.Navigation.IBreadCrumb,Mpos.Shared.Services.Contracts.Dialogs.IBlockerService,Mpos.Shared.Services.Contracts.Logging.ILogger,Mpos.Shared.Model.Proxy.Events.IEventsService,Mpos.Shared.Model.Proxy.Reservation.IReservationService,Mpos.Shared.Services.Contracts.Dialogs.INotificationService,Mpos.Shared.Services.Contracts.Printer.IPrinterService,Mpos.Shared.Services.Contracts.Configuration.IConfigurationService,Mpos.Shared.Services.Contracts.User.ISessionManager,Mpos.Shared.Services.Contracts.Dialogs.IMessageDialogService)': System.ArgumentException: opcode
w Mono.Cecil.Cil.Instruction.Create(OpCode opcode, Byte value)
w ArxOne.MrAdvice.Weaver.Instructions.EmitLdc(Int32 value)
w ArxOne.MrAdvice.Weaver.AspectWeaver.WritePointcutBody(MethodDefinition method, MethodDefinition innerMethod)
w ArxOne.MrAdvice.Weaver.AspectWeaver.WeaveAdvices(MethodDefinition method)
w ArxOne.MrAdvice.Weaver.AspectWeaver.WeaveMethod(ModuleDefinition moduleDefinition, MethodDefinition method, TypeDefinition adviceInterface) Mpos.Modules.Selling

Best regards

Class library aspects are not waved into destination classes

Hi,
I'm wondering about aspect separation for projects. For example I want to have:
ProjName.Aspects
ProjName.Client

Client want to use aspects from library but unfortunatelly they are not injected into classes in Client project. If aspects are defined in Client project everything works fine.

Advice should not advise itself

When an advice is injected at assembly-level, if it is present in this assembly, then it is advised.
A good solution would be to generate an error at weave-time.

Error on extern methods

Example code:

    [MyAdvice]
    class Foo
    {
        [DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
        public static extern int memcmp(byte[] b1, byte[] b2, UIntPtr count);
    }

Gives error:

Error   1   Fody/MrAdvice.Weaver: Error while weaving method 'System.Int32 Example.Foo::memcmp(System.Byte[],System.Byte[],System.UIntPtr)': System.NullReferenceException: Object reference not set to an instance of an object.
at ArxOne.MrAdvice.Weaver.AspectWeaver.WeaveAdvices(MarkedNode markedMethod)
at ArxOne.MrAdvice.Weaver.AspectWeaver.WeaveMethod(ModuleDefinition moduleDefinition, MarkedNode markedMethod, TypeDefinition adviceInterface, Types types) MrAdviceBug

Error in weaving methods

Weaving generates invalid code (or not code at all) for some methods.
See project BlueDwarf (class ConfigurationViewModel) for example.

Setup documentation

Setup wiki pages here, and add readme file to target project linking to it.

Auto dependency properties not found in designer

Auto dependency properties are not found by the XAML designer.
Import auto dependency properties from Blue Dwarf project and create a designer page.
It works with PostSharp, so it should work with Weavisor 😕

Fody error - using MrAdvice with methods with custom types parameters

Hi,

I receive following error from fody during build (VS2013):

Error 1 Fody: An unhandled exception occurred:
Exception:
One or more errors occurred.
StackTrace:
at System.Linq.Parallel.QueryTaskGroupState.QueryEnd(Boolean userInitiatedDispose)
at System.Linq.Parallel.SpoolingTask.SpoolForAll[TInputOutput,TIgnoreKey](QueryTaskGroupState groupState, PartitionedStream2 partitions, TaskScheduler taskScheduler) at System.Linq.Parallel.DefaultMergeHelper2.System.Linq.Parallel.IMergeHelper.Execute()
at System.Linq.Parallel.MergeExecutor1.Execute() at System.Linq.Parallel.MergeExecutor1.Execute[TKey](PartitionedStream2 partitions, Boolean ignoreOutput, ParallelMergeOptions options, TaskScheduler taskScheduler, Boolean isOrdered, CancellationState cancellationState, Int32 queryId) at System.Linq.Parallel.PartitionedStreamMerger1.Receive[TKey](PartitionedStream2 partitionedStream) at System.Linq.Parallel.ForAllOperator1.WrapPartitionedStream[TKey](PartitionedStream2 inputStream, IPartitionedStreamRecipient1 recipient, Boolean preferStriping, QuerySettings settings)
at System.Linq.Parallel.UnaryQueryOperator2.UnaryQueryOperatorResults.ChildResultsRecipient.Receive[TKey](PartitionedStream2 inputStream)
at System.Linq.Parallel.ListQueryResults1.GivePartitionedStream(IPartitionedStreamRecipient1 recipient)
at System.Linq.Parallel.UnaryQueryOperator2.UnaryQueryOperatorResults.GivePartitionedStream(IPartitionedStreamRecipient1 recipient)
at System.Linq.Parallel.QueryOperator1.GetOpenedEnumerator(Nullable1 mergeOptions, Boolean suppressOrder, Boolean forEffect, QuerySettings querySettings)
at System.Linq.Parallel.ForAllOperator1.RunSynchronously() at System.Linq.ParallelEnumerable.ForAll[TSource](ParallelQuery1 source, Action1 action) at ArxOne.MrAdvice.Weaver.AspectWeaver.Weave(ModuleDefinition moduleDefinition) at ModuleWeaver.Execute() at lambda_method(Closure , Object ) at InnerWeaver.ExecuteWeavers() in c:\ConsoleBuildAgent\work\ed448661dbb30d2e\FodyIsolated\InnerWeaver.cs:line 144 at InnerWeaver.Execute() in c:\ConsoleBuildAgent\work\ed448661dbb30d2e\FodyIsolated\InnerWeaver.cs:line 62 Source: System.Core TargetSite: Void QueryEnd(Boolean) opcode StackTrace: at Mono.Cecil.Cil.Instruction.Create(OpCode opcode, Int32 value) at ArxOne.MrAdvice.Weaver.Instructions.EmitLdarg(Int32 index) at ArxOne.MrAdvice.Weaver.AspectWeaver.WritePointcutBody(MethodDefinition method, MethodDefinition innerMethod) at ArxOne.MrAdvice.Weaver.AspectWeaver.WeaveAdvices(MethodDefinition method) at ArxOne.MrAdvice.Weaver.AspectWeaver.<>c__DisplayClass5.<Weave>b__0(MethodDefinition m) at System.Linq.Parallel.ForAllOperator1.ForAllEnumerator1.MoveNext(TInput& currentElement, Int32& currentKey) at System.Linq.Parallel.ForAllSpoolingTask2.SpoolingWork()
at System.Linq.Parallel.SpoolingTaskBase.Work()
at System.Linq.Parallel.QueryTask.BaseWork(Object unused)
at System.Linq.Parallel.QueryTask.RunTaskSynchronously(Object o)
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
Source:
Mono.Cecil
TargetSite:
Mono.Cecil.Cil.Instruction Create(Mono.Cecil.Cil.OpCode, Int32)
Loggerv2

Here is a sample code to recreate the issue.

public class Test
{
    [MyProudAdvice] // this will pass
    public void Method1(FooClass fooClass)
    {
    }


    [MyProudAdvice] // this will pass
    public void Method1A(FooClass foo1, FooClass foo2)
    {
    }

    [MyProudAdvice] // fody error
    public void Method2(FooClass fooClass, string name, long id, long count)
    {
    }

    [MyProudAdvice] // fody error
    public void Method3(string name, FooClass fooClass, long id, long count)
    {
    }

    [MyProudAdvice] // fody error
    public void Method4(string name, long id, FooClass fooClass, long count)
    {
    }

    [MyProudAdvice] // fody error
    public void Method5(string name, long id, long count, FooClass fooClass)
    {
    }

    [MyProudAdvice] // fody error
    public void Method6(FooStruct fooStruct, string name, long id, long count)
    {
    }

    [MyProudAdvice] // fody error
    public void Method6(FooEnum fooEnum, string name, long id, long count)
    {
    }
}

public enum FooEnum
{

}

public struct FooStruct
{
    public int Id { get; set; }
}

public class FooClass
{
    public int Id { get; set; }
}

public class MyProudAdvice : Attribute, IMethodAdvice
{
    public void Advise(MethodAdviceContext context)
    {
        // do things you want here
        context.Proceed(); // this calls the original method
        // do other things here
    }
}

Weaving advices

Allow target assembly to add custom weaving.
Yes, this is huge.

Fix package

Currently, the assembly is not located in its right place, making the continuous integration builds fail.

PEVerify fails for simple advice

The following program fails PEVerify:

using System;
using ArxOne.MrAdvice.Advice;

[assembly: LoggingDemo.LogAdvice]

namespace LoggingDemo
{
    class Program
    {
        static void Main(string[] args)
        {

        }
    }

    [AttributeUsage(AttributeTargets.Assembly)]
    public class LogAdvice : Attribute, IMethodAdvice
    {
        public void Advise(MethodAdviceContext context)
        {
            context.Proceed();
        }
    }
}

The error:

Error   1   Fody: PEVerify of the assembly failed.

Microsoft (R) .NET Framework PE Verifier.  Version  4.0.30319.33440
Copyright (c) Microsoft Corporation.  All rights reserved.

[IL]: Error: [c:\users\u\documents\visual studio 2013\Projects\LoggingDemo\LoggingDemo\bin\Debug\LoggingDemo.exe : LoggingDemo.Program::.ctor][offset 0x00000001][found <uninitialized> ref ('this' ptr) 'LoggingDemo.Program'] Uninitialized item on stack.(Error: 0x80131859)
[IL]: Error: [c:\users\u\documents\visual studio 2013\Projects\LoggingDemo\LoggingDemo\bin\Debug\LoggingDemo.exe : LoggingDemo.Program::.ctor?][offset 0x00000001][found ref ('this' ptr) 'LoggingDemo.Program'] Call to .ctor only allowed to initialize this pointer from within a .ctor. Try newobj.(Error: 0x801318BF)
[IL]: Error: [c:\users\u\documents\visual studio 2013\Projects\LoggingDemo\LoggingDemo\bin\Debug\LoggingDemo.exe : LoggingDemo.LogAdvice::.ctor][offset 0x00000001][found <uninitialized> ref ('this' ptr) 'LoggingDemo.LogAdvice'] Uninitialized item on stack.(Error: 0x80131859)
[IL]: Error: [c:\users\u\documents\visual studio 2013\Projects\LoggingDemo\LoggingDemo\bin\Debug\LoggingDemo.exe : LoggingDemo.LogAdvice::.ctor?][offset 0x00000001][found ref ('this' ptr) 'LoggingDemo.LogAdvice'] Call to .ctor only allowed to initialize this pointer from within a .ctor. Try newobj.(Error: 0x801318BF)
4 Error(s) Verifying c:\users\u\documents\visual studio 2013\Projects\LoggingDemo\LoggingDemo\bin\Debug\LoggingDemo.exe
    LoggingDemo

Configuration related pointcuts

Apply advices depending on configuration (Release, Debug).
The best way would be an attribute applied to advices (such as ConfigurationDependent)

Obfuscators

Curently, weavisor does probably not work when placed before an obfuscator, because it uses hard coded strings to identify target method.

PeVerfiy Error

Running PeVerfiy on the output of this https://github.com/Fody/FodyAddinSamples/tree/master/WeavisorSample results in

Error   5   Fody: PEVerify of the assembly failed.

Microsoft (R) .NET Framework PE Verifier.  Version  4.0.30319.33440
Copyright (c) Microsoft Corporation.  All rights reserved.

[IL]: Error: [C:\Code\Fody\FodyAddinSamples\WeavisorSample\bin\Debug\WeavisorSample.dll : WeavisorSample::MyMethodWithAdvice][offset 0x00000008] initlocals must be set for verifiable methods with one or more local variables.
1 Error(s) Verifying C:\Code\Fody\FodyAddinSamples\WeavisorSample\bin\Debug\WeavisorSample.dll
    WeavisorSample

Performance issue?

Weaving the small tests take up to 400ms, which is big.
Setup some audit to why it is so long.

MrAdvice abstract methods problem

I received following errors when i tried use MrAdvice with abstract method and property

[MyCustomAdvice]
abstract class Foo
{
public abstract void InternalRefresh(bool bar = true);

    public abstract bool KeepAlive { get; }

}

Error 11 Fody/MrAdvice.Weaver: Error while weaving method 'System.Boolean Mpos.Modules.Common.ViewModels.Transactions.TransactionListViewModel::get_KeepAlive()': System.NullReferenceException: Object reference not set to an instance of an object.
at ArxOne.MrAdvice.Weaver.AspectWeaver.WeaveAdvices(MethodDefinition method)
at ArxOne.MrAdvice.Weaver.AspectWeaver.WeaveMethod(ModuleDefinition moduleDefinition, MethodDefinition method, TypeDefinition adviceInterface) Mpos.Modules.Common

Error 10 Fody/MrAdvice.Weaver: Error while weaving method 'System.Void Mpos.Modules.Common.ViewModels.Transactions.TransactionListViewModel::InternalRefresh(System.Boolean)': System.NullReferenceException: Odwołanie do obiektu nie zostało ustawione na wystąpienie obiektu.
w ArxOne.MrAdvice.Weaver.AspectWeaver.WeaveAdvices(MethodDefinition method)
w ArxOne.MrAdvice.Weaver.AspectWeaver.WeaveMethod(ModuleDefinition moduleDefinition, MethodDefinition method, TypeDefinition adviceInterface) Mpos.Modules.Common

Best Regards

MrAdvice.Foody 1.1.9.0 Nuget, compilation error

Project can't be compiled after referencing latest (1.1.9.0) Nuget MrAdvice.Foody (just added reference, nothing else was added)(Win 10 64bit .NET 4.5):

Severity Code Description Project File Line
Error Fody: An unhandled exception occurred:
Exception:
Could not load file or assembly 'Mono.Cecil, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
StackTrace:
at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
at System.Reflection.RuntimeMethodInfo.FetchNonReturnParameters()
at System.Reflection.RuntimeMethodInfo.GetParametersNoCopy()
at System.Reflection.RuntimePropertyInfo.GetIndexParametersNoCopy()
at System.Reflection.RuntimePropertyInfo.GetIndexParameters()
at System.RuntimeType.GetPropertyCandidates(String name, BindingFlags bindingAttr, Type[] types, Boolean allowPrefixLookup)
at System.RuntimeType.GetPropertyImpl(String name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers)
at System.Type.GetProperty(String name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers)
at PropertyDelegateBuilder.BuildPropertySetDelegate[T](Type type, String propertyName) in c:\ConsoleBuildAgent\work\ed448661dbb30d2e\FodyIsolated\DelegateBuilders\PropertyDelegateBuilder.cs:line 9
at DelegateBuilder.BuildDelegateHolder(Type weaverType) in c:\ConsoleBuildAgent\work\ed448661dbb30d2e\FodyIsolated\DelegateBuilders\DelegateBuilder.cs:line 25
at DelegateBuilder.GetDelegateHolderFromCache(Type weaverType) in c:\ConsoleBuildAgent\work\ed448661dbb30d2e\FodyIsolated\DelegateBuilders\DelegateBuilder.cs:line 16
at InnerWeaver.InitialiseWeavers() in c:\ConsoleBuildAgent\work\ed448661dbb30d2e\FodyIsolated\InnerWeaver.cs:line 111
at InnerWeaver.Execute() in c:\ConsoleBuildAgent\work\ed448661dbb30d2e\FodyIsolated\InnerWeaver.cs:line 61
Source:
mscorlib
TargetSite:
Void GetSignature(Void*, Int32, System.RuntimeFieldHandleInternal, System.IRuntimeMethodInfo, System.RuntimeType) GM_YadroModule4

new object[0]

When advised method takes no parameter, a new object[0] is created anyway. A more compact version could use a null instead.

Fody: An unhandled exception occurred after upgrading MrAdvice

Hi,

After upgrading MrAdvice from MrAdvice.Fody.1.1.9 to MrAdvice.Fody.1.2.3 i'm getting following error during build:

Severity Code Description Project File Line Suppression State
Error Fody: An unhandled exception occurred:
Exception:
Exception has been thrown by the target of an invocation.
StackTrace:
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at ModuleWeaver.Execute()
at lambda_method(Closure , Object )
at InnerWeaver.ExecuteWeavers() in C:\projects\fody\FodyIsolated\InnerWeaver.cs:line 161
at InnerWeaver.Execute() in C:\projects\fody\FodyIsolated\InnerWeaver.cs:line 82
Source:
mscorlib
TargetSite:
System.Object InvokeMethod(System.Object, System.Object[], System.Signature, Boolean)
Could not load file or assembly 'MrAdvice, Version=1.2.3.0, Culture=neutral, PublicKeyToken=c0e7e6eab6f293d8' or one of its dependencies. An error relating to remoting occurred. (Exception from HRESULT: 0x8013150B)
StackTrace:
at ArxOne.MrAdvice.Weaver.AspectWeaver.Weave(ModuleDefinition moduleDefinition)
at ModuleWeaver.Execute()
Source:
MrAdvice.Weaver
TargetSite:
Void Weave(Mono.Cecil.ModuleDefinition)
Object '/d7c98439_1587_4fcf_8984_6e3dbb9f50b3/wqxikqsmin706d4l+zcg+rd3_403.rem' has been disconnected or does not exist at the server.
StackTrace:

Server stack trace:
at System.Runtime.Remoting.Channels.ChannelServices.CheckDisconnectedOrCreateWellKnownObject(IMessage msg)
at System.Runtime.Remoting.Channels.ChannelServices.SyncDispatchMessage(IMessage msg)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at ILogger.LogInfo(String message)
at InnerWeaver.b__88_1(String s) in C:\projects\fody\FodyIsolated\WeaverInitialiser.cs:line 25
at ModuleWeaver.OnAssemblyResolve(Object sender, ResolveEventArgs args)
at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)
Source:
mscorlib
TargetSite:
System.Runtime.Remoting.ServerIdentity CheckDisconnectedOrCreateWellKnownObject(System.Runtime.Remoting.Messaging.IMessage)

Best regards

Unwrap exceptions

Currently, exceptions are wrapped in TargetInvocationException 😦

Add initializer only once

Even if invoked several times, the WeavingContext.AddInitializer method has to produce only one injection per distinct parameter.

Factory for interfaces

Allow to create interfaces implementation using one or many aspects at type level.
Ideas:

// may take any arbitrary number of aspects
var i = Weavisor.Factory.Create<Interface,MyAdvice>();
// or
// takes only one aspect but is much nicer
var j = MyAdvice.Handle<Interface>();

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.