Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Web deploy publishes wrong version of assembly

I have a Web API project that has a dependency on System.Web.Http.WebHost and in my project I have set Copy Local = True on that reference, and the version (in this case) is 5.2.3.0.

When I publish the project to the server via web deploy, an older version of this assembly is published (5.2.2.x). This seems to only affect certain people when they publish and not others.

We've run into the same issue with other assemblies in other projects, so this is meant as an example. I can add the affected assembly to the server's GAC or something so it doesn't die when published by a user so affected, but I'd like to know how this happens and how it might be avoided.

like image 421
k3davis Avatar asked Sep 18 '15 16:09

k3davis


1 Answers

In my case, I found that the wrong version of Autofac was being deployed, even though the correct version was referenced and was placed into the bin folder while running locally. I re-installed the NuGet package and even that didn't work.

Ultimately, I found the obj\Release\Package\PackageTmp\bin directory (within the project directory) contained the outdated version, and nothing I did would cause it to update. Simply deleting the directory and letting it regenerate solved the issue.

like image 105
Loren Paulsen Avatar answered Nov 06 '22 07:11

Loren Paulsen