Note that there are some explanatory texts on larger screens.

plurals
  1. PONHibernate - Cannot set the ConfigurationCache property after calling Init
    primarykey
    data
    text
    <p>In my S#arp Arch 2.0 project, I'm communicating with 2 databases. This runs fine locally with the ASP.Net Development Server (VS 2010) and passes unit tests requiring talking to either database.</p> <p>Next step was to Publish the project (using VS' built-in "Publish" menu option) to the in-house development server (Windows Server 2008 R2) and fire this thing up on a real server where people could actually see it.</p> <p>Now I get the exception shown in the title when I try to run the application. The exception is thrown at the = new NHibernateConfigurationFileCache() line below:</p> <pre><code>private void InitialiseNHibernateSessions() { NHibernateSession.ConfigurationCache = new NHibernateConfigurationFileCache(); NHibernateSession.InitStorage(this.webSessionStorage); NHibernateSession.AddConfiguration(NHibernateSession.DefaultFactoryKey, new[] { Server.MapPath("~/bin/SRN2.Infrastructure.dll") }, new AutoPersistenceModelGenerator().Generate(), Server.MapPath("~/NHibernate.config"), null, null, null); NHibernateSession.AddConfiguration(SRN2.Infrastructure.DataGlobals.OTHER_DB_FACTORY_KEY, new string[] { Server.MapPath("~/bin/SRN2.Infrastructure.dll") }, new AutoPersistenceModelGenerator().Generate(), Server.MapPath("~/NHibernate-OTHER.config"), null, null, null); } </code></pre> <p>Stack trace:</p> <pre><code>[InvalidOperationException: Cannot set the ConfigurationCache property after calling Init] SharpArch.NHibernate.NHibernateSession.set_ConfigurationCache(INHibernateConfigurationCache value) +105 SRN2.Web.Mvc.MvcApplication.InitialiseNHibernateSessions() in C:\code\SRN2-Sharp2\trunk\Solutions\SRN2.Web.Mvc\Global.asax.cs:122 SharpArch.NHibernate.NHibernateInitializer.InitializeNHibernateOnce(Action initMethod) +116 SRN2.Web.Mvc.MvcApplication.Application_BeginRequest(Object sender, EventArgs e) in C:\code\SRN2-Sharp2\trunk\Solutions\SRN2.Web.Mvc\Global.asax.cs:71 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +75 </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload