PostSharp AssemblyLoadException

While using PostSharp 4.1.21.0 I had to manually change external library in references, so client could use the newest version. Unfortunately, while building the project, an error occured:

Unhandled exception (4.1.21.0, postsharp.srv.4.0-x86.exe, CLR 4.0.30319.394254, Release): PostSharp.Sdk.CodeModel.AssemblyLoadException:
Cannot find assembly ‘COMPANY.ASSEMBLY, version=1.57.0.0, culture=neutral, publickeytoken=f2a32aaa86fbc479’. [Version mismatch]

===============================================================
w PostSharp.Sdk.CodeModel.Domain.GetAssembly(IAssemblyName assemblyName, BindingOptions bindingOptions, AssemblyLoadContext context)
w PostSharp.Sdk.Extensibility.Tasks.MulticastAttributeTask.^SgrhoGlQ(AssemblyRefDeclaration _0)
w PostSharp.Sdk.Extensibility.Tasks.MulticastAttributeTask.^+GwnKh4ZYHu3()
w PostSharp.Sdk.Extensibility.Tasks.MulticastAttributeTask.Execute()
w PostSharp.Sdk.Extensibility.Project.ExecutePhase(String phase)
w PostSharp.Sdk.Extensibility.Project.Execute()
w PostSharp.Hosting.PostSharpObject.ExecuteProjects()
w PostSharp.Hosting.PostSharpObject.InvokeProject(ProjectInvocation projectInvocation)

As we see – postsharp.srv process stored somewhere the information about the old version. The workaroud of this problem takes two steps:
1. Tell PostSharp to process web.config file using extra lines inside project file (.csproj)


   web.config

2. Put information about your assembly into web.config, so the process could get the information about new version

 
    
    
 

Używane laptopy białystok
Dobre laptopy białystok

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *