Could not load file or assembly Exception

Original Post Raju's Avatar

Raju

26 May, 2010 07:28 AM via web

Could not load file or assembly 'Castle.DynamicProxy2, Version=2.1.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.

I'm getting above error because I've Castle.DynamicProxy2, Version=2.2.0.0. Due to some reasons i need to use Castle.DynamicProxy2, Version=2.2.0.0. Any help regards this?

  1. 2 Posted by Devon Lazarus on 27 May, 2010 02:15 PM

    Devon Lazarus's Avatar

    This is (unfortunately) fairly common in the open-source world. Luckily, it is a relatively easy fix. You'll need to add an <assemblyBinding> attribute to your App.config file telling your app to look for the new version when the old version is requested.

    Here is an example:

    <runtime>
        ...
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="Castle.DynamicProxy2" publicKeyToken="407dd0808d44fbdc" culture="neutral" />
            <bindingRedirect oldVersion="2.1.0.0" newVersion="2.2.0.0" />
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
    

    hth,

    -devon

  2. 3 Posted by Raju on 27 May, 2010 02:31 PM

    Raju's Avatar

    Thanks Man!!!

  3. 4 Posted by Devon Lazarus on 27 May, 2010 10:34 PM

    Devon Lazarus's Avatar

    Glad it worked. Don't forget to mark the question resolved in the queue.

    Cheers!

    -d

  4. James Gregory resolved this discussion on 28 May, 2010 08:39 AM.

Comments are currently closed for this discussion. You can start a new one.

Recent Discussions

05 Jul, 2010 10:29 PM
05 Jul, 2010 12:45 PM
05 Jul, 2010 12:42 PM
05 Jul, 2010 12:17 PM
05 Jul, 2010 12:12 PM

 

03 Jul, 2010 12:26 AM
02 Jul, 2010 02:17 PM
02 Jul, 2010 08:18 AM
02 Jul, 2010 12:20 AM
01 Jul, 2010 10:14 PM