views:

427

answers:

1

I have a web site project that I run from Visual Studio using the built in development web server. The virtual path of the web site is set to /

The web.config contains a runtime element with

<runtime>
  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
      <assemblyIdentity name="CMS.Controls" publicKeyToken="834b12a258f213f9" culture="neutral" />
      <bindingRedirect oldVersion="4.1.3518.21577" newVersion="4.1.3561.21846" />
    </dependentAssembly>
  </assemblyBinding>
</runtime>

I have already removed the xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0" attribute from the root configuration element.

Here is the error:

Could not load file or assembly 'CMS.Controls, Version=4.1.3518.21577, Culture=neutral, PublicKeyToken=834b12a258f213f9' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Here is the log of the binding:

The operation failed.
Bind result: hr = 0x80131040. No description available.
...
LOG: DisplayName = CMS.Controls, Version=4.1.3518.21577, Culture=neutral, PublicKeyToken=834b12a258f213f9
 (Fully-specified)
...
LOG: This bind starts in default load context.
LOG: Using application configuration file: D:\Project\WebSite\web.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: CMS.Controls, Version=4.1.3518.21577, Culture=neutral, PublicKeyToken=834b12a258f213f9
...
LOG: Assembly Name is: CMS.Controls, Version=4.1.3561.21846, Culture=neutral, PublicKeyToken=834b12a258f213f9
WRN: Comparing the assembly name resulted in the mismatch: Revision Number

Seems to me like it's ignoring my redirect. I've been looking at it for an hour, do I have a typo or something?

Thanks!

A: 

Have you tried using the FUSLOGVW.exe found in the SDK bin folder for your Visual Studio installation? This gives a more verbose output for the assembly binding failures.

The manifest not matching the assembly reference basically means it's found the wrong assembly as the manifest is the metadata that describes the assembly and its contents. I found this series of articles explained a lot for me about how the assembly bindings work; .NET Assembly FAQ – Part 1

Dave Anderson
The log I show in my question IS the output of FUSLOGVW.EXE.And the manifest not matching IS the reason I need to redirect. The question remains: why is it not redirected?
michielvoo