POSTSHARP error PS0052: The plug-in “PostSharp.Patterns.Diagnostics.Weaver” was not found

After some merge of source code branches I’ve got a build error
 POSTSHARP : error PS0052: The plug-in “PostSharp.Patterns.Diagnostics.Weaver” required by the type “PostSharp.Patterns.Diagnostics.ILogAspect” was not found. 
[C:Builds\MAIN_MasterSourcesmainServiceInterfacesmyProj.csproj]
I wasn’t able to find immediately which code caused the error, and google also didn’t give me an answer.
After some investigation I found that PSproj file had missing entries for PostSharp.Toolkit.Diagnostics.Weaver.dll and PostSharp.Toolkit.Diagnostics.Weaver.NLog.dll.

It will be easier if error PS0052 will include name and line from PSproj file

<Project xmlns=http://schemas.postsharp.org/1.0/configuration xmlns:dg=clr-namespace:PostSharp.Patterns.Diagnostics;assembly:PostSharp.Patterns.Diagnostics ReferenceDirectory={$ReferenceDirectory} >
  <Property Name=LoggingBackEnd Value= nlog  />
  <Using File=default />
  <!– if the following 2  entries will be missing, it would cause PS0052 error –>
<Using File=”……packagesPostSharp.Toolkit.Diagnostics.NLog.2.1.1.12toolsPostSharp.Toolkit.Diagnostics.Weaver.NLog.dll” />
  <Using File=”……..packagesPostSharp.Toolkit.Diagnostics.2.1.1.12toolsPostSharp.Toolkit.Diagnostics.Weaver.dll” /> 
  
  <dg:LoggingProfiles>
    < dg:LoggingProfile Name = Exceptions OnExceptionOptions=IncludeParameterType | IncludeParameterName | IncludeParameterValue | IncludeThisArgument OnEntryLevel=None OnSuccessLevel = None />
  </dg:LoggingProfiles>

  <Multicast>
    <!– Add exception logging to everything  .–>
    < LogExceptionAttribute xmlns=clr-namespace:PostSharp.Patterns.Diagnostics;assembly:PostSharp.Patterns.Diagnostics  AttributeTargetAssemblies=“MyProj.ServiceInterfaces AttributeTargetTypes=MyProj.ServiceInterfaces.* AttributeTargetMembers= * />
  </Multicast>
</Project>
Advertisements