Castle.DynamicProxy2 mismatch?

Original Post lance.harper's Avatar

lance.harper

15 Jun, 2010 11:33 PM via web

When calling into Session.CreateCriteria, I receive an exception:

"Could not load file or assembly 'Castle.Core, Version=1.1.0.0".

The issue seems related to the one found here: http://stackoverflow.com/questions/2918855/fluentnhibernate-1-1-cas...

I am attempting to use a newer version (2.2.0.0) of Castle.DynamicProxy2.dll that is required for Castle.Windsor, which I am using for dependency registration. The version of Castle.DynamicProxy2.dll that came with Fluent NHibernate is 2.1.0.0. Reverting back to 2.1 breaks Castle Windsor.

Thank you in advance for any suggestions someone might have.

I may be wrong about the issue, but assuming I am correct, do I need to do some sort of bindingRedirect or is this updated version of Castle.DynamicProxy2 not supported with Fluent NHibernate?

  1. 2 Posted by lance.harper on 15 Jun, 2010 11:38 PM

    lance.harper's Avatar

    After being perplexed for a few hours, it turns out a related topic was on these support forums and I figured it out not long after posting my question.

    If anyone else has this issue, the solution for me was to add this to my web.config:

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

Reply to this discussion

Preview Comments are parsed with Markdown. Help with syntax

Attached Files

    You can attach files up to 10MB

    What is the opposite of bad?

    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