A storage mechanism has already been configured for this application

匆匆过客 提交于 2021-02-08 13:27:04

问题


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


回答1:


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

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




回答2:


NHibernateSession.Init() or InitStorage() is being called more than once. You're probably calling it every request, it's supposed to be called only once at startup.




回答3:


In an old application I have to maintain, this happened when the application start had issues. So I just had to recycle the application pool in IIS.



来源:https://stackoverflow.com/questions/2945452/a-storage-mechanism-has-already-been-configured-for-this-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!