The problem is the weaver.exe is being used as my project which is a class library is targeting .net standard 2.0 and in the MrAdvice.targets file there are no condition for .net2.0 standard which is why instead of dll the agent is picking up exe file which is causing the error, could you please add a condition for .net standard 2.0 to use the weaver.dll