"O inicializador de tipo de 'CriarGerenciadorDeSessao' acionou uma exceção."
Estou recendo essa mensagem de erro ao tentar compilar minha aplicação. Alguém poderia me orientar uma forma de resolver esse problema?
Mensagem de erro:
HibernateException: The IDbCommand and IDbConnection implementation in the assembly Oracle.DataAccess could not be found. Ensure that the assembly Oracle.DataAccess is located in the application directory or in the Global Assembly Cache. If the assembly is in the GAC, use <qualifyAssembly/> element in the application configuration file to specify the full name of the assembly.
Classe nhibernateHelper:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate.Mapping.Attributes;
using NHibernate.Cfg;
using NHibernate;
using System.IO;
using NHibernate.Context;
namespace SDPJDominio.DataAccess
{
public class NhibernateHelper
{
private readonly ISessionFactory sessionFactory;
public static ISession GetSessao()
{
return Instancia.GetSessionFactory().GetCurrentSession();
}
private NhibernateHelper()
{
MemoryStream stream = new System.IO.MemoryStream();
HbmSerializer.Default.Validate = true;
HbmSerializer.Default.Serialize(stream, System.Reflection.Assembly.GetExecutingAssembly());
stream.Position = 0;
Configuration configuracao = new Configuration();
//configuracao = ConfigNhibernate.getConfig(configuracao);
configuracao.Configure();
configuracao.SetProperty("connection.connection_string", ConfigNhibernate.getConfig()); //add essa linha
configuracao.AddInputStream(stream);
stream.Close();
sessionFactory = configuracao.BuildSessionFactory();
}
public static ISessionFactory SessionFactory
{
get { return Instancia.sessionFactory; }
}
private ISessionFactory GetSessionFactory()
{
return sessionFactory;
}
public static NhibernateHelper Instancia
{
get
{
return CriarGerenciadorDeSessao.gerenciadorDeSessao;
}
}
public static ISession AbrirSessao()
{
return Instancia.GetSessionFactory().OpenSession();
}
public static void RecarregarSessao(object obj)
{
SessaoCorrente.Refresh(obj);
}
public static ISession SessaoCorrente
{
get
{
return Instancia.GetSessionFactory().GetCurrentSession();
}
}
class CriarGerenciadorDeSessao
{
internal static readonly NhibernateHelper gerenciadorDeSessao = new NhibernateHelper();
}
}
}
Mensagem referente ao StackTrace:
Name
Value
Type
StackTrace
" em SDPJDominio.DataAccess.NhibernateHelper.get_SessionFactory() na D:\\Repositório SVN\\SDP\\SDPJ\\branches\\SDPJ-v6.0.0\\SDPJDominio\\DataAccess\\NhibernateHelper.cs:linha 39"
stringDiscussão (1)
Carregando comentários...