views:

132

answers:

4

Hello, I have a deployed web application project that references my Utility.dll class library. I want to make a change to the Utlity.dll and roll only that .dll out. The problem is that when I do that, I get the following error when I try to launch my site:

Could not load file or assembly 'Utility, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3766481cef20a9d1' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Is there a setting I can change so I don't have to roll out the entire web application project - only the Utlity.dll? Thanks!

A: 

If the version of your assembly has changed, you -could- force the version back to 1.0.0.0

Though this is not recommended.

Also what assemblies does it reference, and did you update them as well when you updated utility?

Also if the library is signed, and the referencing assembly expects the signed library, you will most likely just have to update the entire project.

Aequitarum Custos
My web application project references by Utility.dll, which is its own class library. I only modified Utility.dll, and I did not need to modify my web project. Utility.dll is signed. Am I out of luck?
Mike C.
A: 

Try to modify Assemblies section in the web.config file to change an assembly version to required one

Laserson
Can you elaborate on this a bit?
Mike C.
A: 

There is an "Assemblies" section in "web.config" file in the root of your website. This section stores information about all referenced assemblies and web application loads assemblies according to this file. Every referenced assembly has a record in this section like this one:

<add assembly="Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>

Try to change Version attribute of this record (in my example it has value 7.0.3300.0) to the necessary version

Laserson
? My references aren't listed there.
Mike C.
Hm...How did you add references? Simply copied into Bin folder? Use Add Reference item in the website project menu.
Laserson
I am using a Web Application Project. I right clicked on references and clicked Add Reference.
Mike C.
A: 

I modified the assembly bindings in my web.config file to fix this issue. I used the following examples that were already there:

<runtime>
  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
      <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" />
      <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
    </dependentAssembly>
    <dependentAssembly>
      <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35" />
      <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
    </dependentAssembly>
  </assemblyBinding>
</runtime>
Mike C.