title: Could not load type Nhibernate.Dialect.MsSql2012Dialect. Possible cause: no assembly name specified
body: <p><a href="https://i.stack.imgur.com/HaAXn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HaAXn.png" alt="error picture"></a></p>
  
  <p>This is the error i am getting during running the application.Could not load type nhibernate.Mssql2012.I m using sqlserver 2012 ,visual studio 2015</p>
  
  <p>strong text
  Web config:</p>
  
  <pre><code>&lt;configuration&gt;
    &lt;configSections&gt;
      &lt;!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --&gt;
      &lt;section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /&gt;
    &lt;section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSectionHandler,Nhibernate"/&gt;
    &lt;/configSections&gt;
    &lt;connectionStrings&gt;
      &lt;add name="MainDatabase" connectionString="Data Source=SARVESH\SQLEXPRESS;Database=SimpleBlog;Integrated Security=True"/&gt;
    &lt;/connectionStrings&gt;
    &lt;hibernate-configuration xmlns="urn:nhibernate-configuration-2.2"&gt;
        &lt;session-factory&gt;
  
        &lt;property name="dialect"&gt;Nhibernate.Dialect.MsSql2012Dialect&lt;/property&gt;  
          &lt;property name="connection.provider"&gt;Nhibernate.Connection.DriverConnectionProvider&lt;/property&gt;
          &lt;property name="connection.driver_class"&gt;Nhibernate.Driver.SqlClientDriver&lt;/property&gt;
          &lt;property name="connection.connection_string_name"&gt;MainDatabase&lt;/property&gt;
  
  
  
        &lt;/session-factory&gt;
  
  
      &lt;/hibernate-configuration&gt;
  
    &lt;appSettings&gt;
      &lt;add key="webpages:Version" value="3.0.0.0" /&gt;
      &lt;add key="webpages:Enabled" value="false" /&gt;
      &lt;add key="ClientValidationEnabled" value="true" /&gt;
      &lt;add key="UnobtrusiveJavaScriptEnabled" value="true" /&gt;
    &lt;/appSettings&gt;
  </code></pre>
  
  <p>Database.cs</p>
  
  <pre><code>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&lt;UserMap&gt;();
              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);
  
          }
      }
  }
  </code></pre>