PostSharp AssemblyLoadException

While using PostSharp 4.1.21.0 I had to manually change external library in references, so the app could use the newest version. It turned out to be more difficult than I thought. Unfortunately, while building the project, an error occurred:

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 – I could not even build a project. The workaround for this problem take 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 *