Updating a DLL in a Production ASP.NET Web Site bin folder

20,342

Solution 1

The thing to remember is that there are web sites and web applications as far as Visual Studio and ASPNET is considered.

Web Sites typically have all of the aspx and vb files published to the live server and ASPNET Worker Process recompiles the app every time before presentation.

On the other end is the web application, where all of your code behind files get compiled down to a single DLL file and you simply deploy your aspx pages and you bin folder with the DLL file to production.

There is also a "hybrid" known as "Precompiled Web Sites" (see the link for the official MSDN overview) where you don't have the single DLL layout of a web application, but all the compile work of the website is done for you. There are several "modes" to this depending on your needs.

It seems to me that your error is caused because your site is set up as a web site with some kind of precompilation in place. Using the pre-compiled model is a little more "strict" in that is assumes certain files/signatures are in place. Having an updated version of the DLL file causes a break since the precompilation wants a name and a version of the file.

If possible, your best bet would be to convert to a web application, since you can add the additional DLLs into production without a problem. Otherwise, take a look at this matrix to see what form of precompilation you need for your application.

Solution 2

Look at this SO post, might be what you are referring to. The located assembly's manifest definition does not match the assembly reference

Share:
20,342

Related videos on Youtube

Josh Stodola
Author by

Josh Stodola

I make things happen. I am a seasoned web developer with 15+ years of experience. I am fluent in CSS and Javascript. On the server-side, I prefer the Microsoft stack (.NET) but am not opposed to anything that works. I have ten years of experience working with legacy IBM mainframe systems, which helps me appreciate how far we have come as software engineers. Twitter " There are any number of ways to do this, and most of them are wrong "

Updated on April 01, 2020

Comments

  • Josh Stodola
    Josh Stodola about 4 years

    I want to update a class library (a single DLL file) in a production web application. This web app is pre-compiled (published). I read an answer on StackOverflow (sorry, can't seem to find it anymore because the Search function does not work very well), that led me to believe that I could just paste the new DLL in the bin folder and it would be picked up without problems (this would cause the WP to recycle, which is fine with me because we do not use InProc session state).

    However, when I tried this, my site blows up and gives a FileLoadException saying that the assembly manifest definition does not match the assembly reference. What in the world is this?! Updating the DLL in Visual Studio and re-deploying the entire site works just fine, but it is a huge pain in the rear. What is the point of having a separate DLL if you have to re-deploy the entire site to implement any changes?

    Here's the question: How can I update a DLL on a production web site without breaking the app and without re-deploying all of the files?

  • Josh Stodola
    Josh Stodola about 14 years
    That's not the one. It had an answer that said something to the effect of "Yes just drop yuor new DLL in the bin folder and it will recycle the app pool and get picked up." It was an accepted answer and had been up voted a few times. I left a comment on the answer about FileLoadException.
  • Josh Stodola
    Josh Stodola about 14 years
    Where do I find this "specific version"?
  • Dustin Laine
    Dustin Laine about 14 years
    In the reference properties. Expand references, right click on the specific reference, click properties.
  • Josh Stodola
    Josh Stodola about 14 years
    I cant find what you are talking about. This is a web site, not a web application.
  • citronas
    citronas about 14 years
    Hmm well you said "web app" first. Then my awswer is not applicable to your situation.
  • Josh Stodola
    Josh Stodola about 14 years
    Well, it is a web application, per se. But Visual Studio decided to come up with its own stupid terminology to confuse everybody. According to VS, this is a web site.
  • Josh Stodola
    Josh Stodola about 14 years
    +1 Thanks, this is a good answer. I am still somewhat confused on the web application conversion process. What is exactly involved with "converting to a web application"? Thanks again!
  • Dillie-O
    Dillie-O about 14 years
    You should be able to right click on the project file and select "Convert to Web Application" and it will do the process for you.
  • Josh Stodola
    Josh Stodola about 14 years
    I do not have the "Convert to Web Application" option in my solution explorer context menu. I have VS2008 professional edition. I am not blind, it simply is not there! Is there some kind of add-on that I need for this? Thanks.
  • Dillie-O
    Dillie-O about 14 years
    I believe the option is in the context menu of the project, not the solution. Try there.
  • Josh Stodola
    Josh Stodola about 14 years
    @Dillie I have tried everything and I simply do not have a "Convert to Web Application" option. I've been searching around trying to figure out if there is some special version of VS or maybe a service pack that I don't have installed or something but it appears I am up to date on everything!
  • Dillie-O
    Dillie-O about 14 years
    Seems odd. Can you right click on your project to display the context menu in the solution explorer and then update the question with that screen shot? There may be something I'm missing here.