asp.net-mvcnhibernatesharp-architecture

A storage mechanism has already been configured for this application


I am getting this error whenever my S#arp Architecture attempts to start and this is an problem with SQL Server (for example: SQL Server is not runing), after I start SQL Server and hit refresh, I get this error:

A storage mechanism has already been configured for this application


Solution

  • Try to add this line before calling NHibernateSession.Init() to clear any previous initiation.

    try{ NHibernateSession.Reset(); } catch { }