Install NHibernate 3.2 with NuGet

前端 未结 5 851
慢半拍i
慢半拍i 2021-02-03 20:40

I\'m new to NHibernate and have been trying to get up and running with it, Fluent NHibernate and NHProf using NuGet. After reading this article (http://gurustop.net/blog/2011/0

相关标签:
5条回答
  • 2021-02-03 21:15

    Each version of Fluent NHibernate uses an exact version of NHibernate (included in the Fluent NHibernate package) You should remove the NHibernate package and add only Fluent NHibernate

    0 讨论(0)
  • 2021-02-03 21:23

    If you use the Nuget Package Manager Console instead of the GUI to get the package (Install-Package FluentNHibernate) you will get version 1.3.0.717 which is compatible with NHibernate 3.2 enter image description here

    I tried and is working fine for me. I answered this already on this link: which version of fluent nhibernate is compatible with nhibernate 3.2

    0 讨论(0)
  • 2021-02-03 21:26

    NHibernate 3.2 comes with its own proxy factory. If you're using a config file, you just need to remove the proxyfactory configuration property.

    I believe the version of Fluent NHibernate that you're using defaults to use NHibernate.ByteCode.Castle. In that case, you would need to override that setting with the built in NHibernate 3.2 proxy factory:

    .ProxyFactoryFactory("NHibernate.Bytecode.DefaultProxyFactoryFactory, NHibernate") 
    
    0 讨论(0)
  • 2021-02-03 21:27

    NHibernate 3.2 comes with its own mapping configuration (Conform). FluentNHibernate only works with NHibernate 3.1 as a result of this, you can't use 3.2 (I had the same problem). So you'll have to manually download 3.1 and reference that unless NuGet allows you to use 3.1 directly.

    Your other option is to remove all references to 3.2 and then install FluentNHibernate from NuGet, then the dependency resolver will kick in and automatically include NHibernate 3.1 for you.

    0 讨论(0)
  • 2021-02-03 21:28

    I'm using this consctruction in config file to make FluentNhibernate work with NHibernate 3.2

     <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="NHibernate" publicKeyToken="aa95f207798dfdb4" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-3.2.0.1001" newVersion="3.2.0.1001" />
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
    
    0 讨论(0)
提交回复
热议问题