我試圖將具有網絡服務身份的應用程序池中的工作S#arp體系結構MVC應用程序切換爲具有域用戶身份的應用程序池。我在web服務器上的用戶上運行了aspnet_regiis,併爲用戶提供了訪問數據庫的權限(甚至試圖將它作爲數據庫中的一個系統管理員)。但是,它似乎無法獲得NHibernate會話。切換到Windows身份驗證時未能獲得NHibernate會話
Exception information:
Exception type: NullReferenceException
Exception message: Object reference not set to an instance of an object.
Request information:
Request URL: http://<redacted>
Request path: /<redacted>
User host address: 10.10.10.10
User: <webuser>
Is authenticated: True
Authentication Type: Forms
Thread account name: <MYDOMAIN\MYUSER>
Thread information:
Thread ID: 1
Thread account name: <MYDOMAIN\MYUSER>
Is impersonating: False
Stack trace: at SharpArch.Data.NHibernate.NHibernateSession.get_Current() in C:\MyStuff\Dev\Projects\SharpArchitecture\src\SharpArch\SharpArch.Data\NHibernate\NHibernateSession.cs:line 88
at UserAccount.Persistence.UserRepository.GetByPropertiesPartialMatching(IDictionary`2 exactMatchPropertyValuePairs, IDictionary`2 partialMatchPropertyValuePairs, MatchMode matchMode) in c:\Persistence\UserRepository.cs:line 66
...
實際的線給SharpArch NHibernateSession.cs內的空引用例外是:在服務器上
ISession session = Storage.Session;
爲什麼會出現一個NullReferenceException?什麼變成空? –