
Это ошибка, которую я получаю во время запуска приложения. Не удалось загрузить тип nhibernate. Mssql2012. Я использую SQL Server 2012, Visual Studio 2015
Веб-конфигурация:
Nhibernate.Dialect.MsSql2012Dialect
Nhibernate.Connection.DriverConnectionProvider
Nhibernate.Driver.SqlClientDriver
MainDatabase
Database.cs
namespace simpleblog
{
public static class Database
{
private const string SESSION_KEY = "simpleblog.database.sessionkey";
private static ISessionFactory _sessionFactory;
public static ISession session
{
get { return (ISession)HttpContext.Current.Items[SESSION_KEY]; }
}
public static void Configure()
{
var config = new Configuration();
//configure the connection strings
config.Configure();
//add our mappings
var mapper = new ModelMapper();
mapper.AddMapping();
config.AddMapping(mapper.CompileMappingForAllExplicitlyAddedEntities());
//create session factory
_sessionFactory = config.BuildSessionFactory();
}
public static void OpenSession()
{
HttpContext.Current.Items[SESSION_KEY]= _sessionFactory.OpenSession();
}
public static void CloseSession()
{
var session = HttpContext.Current.Items[SESSION_KEY] as ISession;
if (session != null)
session.Close();
HttpContext.Current.Items.Remove(SESSION_KEY);
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/382 ... se-no-asse
Мобильная версия