Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Fluent nhibernate Fluent nHibernate使用Oracle创建SessionFactory时出错_Fluent Nhibernate - Fatal编程技术网

Fluent nhibernate Fluent nHibernate使用Oracle创建SessionFactory时出错

Fluent nhibernate Fluent nHibernate使用Oracle创建SessionFactory时出错,fluent-nhibernate,Fluent Nhibernate,当我尝试BuildSessionFactory()时,我收到一个错误,说它找不到以下程序集: 无法从NHibernate.driver.OracleDataClientDriver创建驱动程序,NHibernate,版本=2.1.2.4000 我在我的bin文件夹和本地文件夹中引用了Oracle.DataAccess 4.11版,我正在使用: 甲骨文10及 VisualStudio2010.NET4 并使用以下方法调用: public static ISessionFactory CreateS

当我尝试BuildSessionFactory()时,我收到一个错误,说它找不到以下程序集:

无法从NHibernate.driver.OracleDataClientDriver创建驱动程序,NHibernate,版本=2.1.2.4000

我在我的bin文件夹和本地文件夹中引用了Oracle.DataAccess 4.11版,我正在使用:

甲骨文10及 VisualStudio2010.NET4

并使用以下方法调用:

public static ISessionFactory CreateSessionFactory()
    {
        FluentConfiguration idk = Fluently
            .Configure()
            .Database(OracleDataClientConfiguration
                .Oracle9
                .UseReflectionOptimizer()
                .MaxFetchDepth(3)
                .AdoNetBatchSize(500)
                .ConnectionString(cs => cs
                .Server("Paul-PC")
                .Port(1521)
                .Instance("xe")
                .Username("xxxx")
                .Password("xxxx")
                .Pooling(true)
                .StatementCacheSize(100)
                .OtherOptions(
                "Min Pool Size=10;Incr Pool Size=5;Decr Pool Size=2;")
            )
            // It does this automatically.. but I like to be explicit ;)
            .ProxyFactoryFactory("NHibernate.ByteCode.Castle.ProxyFactoryFactory,NHibernate.ByteCode.Castle")
            .ShowSql()
            )
            .Mappings(m => m.FluentMappings.Add(typeof(PortalUserMap)));

        idk.ExposeConfiguration(BuildSchema);

        return idk.BuildSessionFactory();
    }
PortalUserMap类如下所示:

using System;
使用System.Collections.Generic; 使用System.Linq; 使用系统文本; 使用FluentNHibernate.Mapping; 使用Mobisoft.Portal.Security.Entities

命名空间Mobisoft.Portal.Security.Mappings { 公共类PortalUserMap:ClassMap { 公共PortalUserMap() { 表(“PORTALUSER”)

请有人帮帮我,我已经在网上找了两天的答案了


Paul。

更新项目中对Oracle.DataAccess.dll的引用,将CopyLocal设置为True。

更新项目中对Oracle.DataAccess.dll的引用,将CopyLocal设置为True。

Fluent NHibernate 1.1引用NHibernate 2.1.X,您需要在项目中引用Fluent NHibernate 1.2,然后才能将其与NHib一起使用ernate 3.0.4或更高版本,我猜您正在使用。 你可以从这里下载

Fluent NHibernate 1.1参考NHibernate 2.1.X,您需要在项目中参考Fluent NHibernate 1.2,然后才能将其与NHibernate 3.0.4或更高版本一起使用,我猜您使用的是。 你可以从这里下载

        Id(x => x.Id, "ID").GeneratedBy.Identity();
        Map(x => x.Name, "NAME");
    }

}