Der Typ Nhibernate.Dialect.MsSql2012Dialect konnte nicht geladen werden. Mögliche Ursache: Kein Assemblyname angegebenC#

Ein Treffpunkt für C#-Programmierer
Anonymous
 Der Typ Nhibernate.Dialect.MsSql2012Dialect konnte nicht geladen werden. Mögliche Ursache: Kein Assemblyname angegeben

Post by Anonymous »

Image

Dies ist der Fehler, der beim Ausführen der Anwendung angezeigt wird. Der Typ „nhibernate“ konnte nicht geladen werden. Mssql2012. Ich verwende SQL Server 2012, Visual Studio 2015
Webkonfiguration:

Code: Select all












Nhibernate.Dialect.MsSql2012Dialect
Nhibernate.Connection.DriverConnectionProvider
Nhibernate.Driver.SqlClientDriver
MainDatabase










Database.cs

Code: Select all

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

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post