views:

42

answers:

1

Hi,

When I attempt to BuildSessionFactory() I get an error saying it cannot find the following assembles:

Could not create the driver from NHibernate.Driver.OracleDataClientDriver, NHibernate, Version=2.1.2.4000

I have a reference to the Oracle.DataAccess version 4.11 in my bin folder and local, I am using:

Oracle 10 and Visual Studio 2010 .NET 4

And calling with the method below:

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();
    }

The PortalUserMap class is below:

using System;

using System.Collections.Generic; using System.Linq; using System.Text; using FluentNHibernate.Mapping; using Mobisoft.Portal.Security.Entities;

namespace Mobisoft.Portal.Security.Mappings { public class PortalUserMap : ClassMap { public PortalUserMap() { Table("PORTALUSER");

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

}

Please someone help me, I have been trying to find an answer online for two days now.

Paul.

A: 

Update the reference to Oracle.DataAccess.dll in your project, setting CopyLocal to True.

Nicholas Murray

related questions