title: Is there a way to get Nhibernate 3 to work with Sharp Architecture using Visual Studio 2008?
body: <p>I have been trying to find a version of Sharp Architecture which works with Visual Studio 2008 and uses NHibernate 3 but have been unsucsessful. I want to use the QueryOver API from NHibernate version 3. The latest build available that I can find is sharp-architecture-1.6.0.0-templify-package.zip which is compatibale with Visual Studio 2008, MVC 2 and NHibernate 2. All the newer version of Sharp Architecture are only compatible with Visual Studio 2010. I attempted to make a custom build of Sharp Architecture:</p>
  
  <p>I changed the references in the "SharpArchitecture 1.6 Full Source" project...:</p>
  
  <ul>
  <li>NHibernate.Validator to Version 1.3.0.4000</li>
  <li>NHibernate to Version 3.1.0.4000</li>
  <li>NHibernate.ByteCode.Castle to Version 3.1.0.4000</li>
  <li>FluentNHibernate to Version 1.2.0.694</li>
  <li>Castle.Core to Version=2.5.2.0 </li>
  </ul>
  
  <p>...by replacing the old dlls with the new ones in the projects bin directory. Then I ran ClickToBuild.bat (located in the downloaded Sharp Architecture zip file base directory) to build the solution. The build succeeded and all the tests passed. Then I replaced the all dlls in my own project with the new Sharp Architecture ones I just built. My project does compile, but when I run it, SharpArch.Data\NHibernate\NHibernateSession.cs throws the following exception:</p>
  
  <blockquote>
    <p>Could not load file or assembly 'Castle.Core, Version=2.5.1.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)</p>
  </blockquote>
  
  <p>I tried using a bindingRedirect for Castle.Core in my web.config:</p>
  
  <pre><code>&lt;configuration&gt;
      &lt;runtime&gt;
          &lt;assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"&gt;
              &lt;dependentAssembly&gt;
                  &lt;assemblyIdentity name="Castle.Core" publicKeyToken="407dd0808d44fbdc" culture="neutral"/&gt;
                  &lt;bindingRedirect oldVersion="2.5.1.0" newVersion="2.5.2.0"/&gt;
              &lt;/dependentAssembly&gt;
          &lt;/assemblyBinding&gt;
      &lt;/runtime&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>but that still did not work.</p>
  
  <p>Am I on the right track? What else can I do to get it to work?</p>