【发布时间】:2009-08-13 14:28:38
【问题描述】:
注意:我也在sharp architecture google groups上发布了这个。
描述:执行过程中发生了未处理的异常 当前的网络请求。请查看堆栈跟踪以获取更多信息 有关错误的信息以及它在代码中的来源。
异常详细信息:SharpArch.Core.PreconditionException:一个会话 工厂已经配置了密钥 nhibernate.current_session
来源错误:
第 49 行:base.Init(); 第 50 行: 第 51 行:NHibernateSession.Init(new WebSessionStorage (这), 第 52 行:新字符串 [] { Server.MapPath("~/bin/ GCBA.Data.dll") }); 第 53 行:}
源文件:C:\Users\Matt\Desktop\Matt\GCBA\GCBA\GCBA.Web \Global.asax.cs 行:51
堆栈跟踪:
[PreconditionException: 已经配置了会话工厂 使用 nhibernate.current_session 的键]
SharpArch.Core.Check.Require(Boolean assertion, String message) in C:\MyStuff\Projects\SharpArchitecture\src\SharpArch\SharpArch.Core \DesignByContract.cs:62
SharpArch.Data.NHibernate.NHibernateSession.Init(ISessionStorage 存储,String[] mappingAssemblies,AutoPersistenceModel autoPersistenceModel,字符串 cfgFile,IDictionary`2 cfgProperties, String validatorCfgFile, IPersistenceConfigurer persistenceConfigurer) 在 C:\MyStuff\Projects\SharpArchitecture\src\SharpArch\SharpArch.Data \NHibernate\NHibernateSession.cs:70
SharpArch.Data.NHibernate.NHibernateSession.Init(ISessionStorage storage, String[] mappingAssemblies) 在 C:\MyStuff\Projects \SharpArchitecture\src\SharpArch\SharpArch.Data\NHibernate \NHibernateSession.cs:26
GCBA.Web.MvcApplication.Init() 在 C:\Users\Matt\Desktop\Matt\GCBA \GCBA\GCBA.Web\Global.asax.cs:51
System.Web.HttpApplication.InitInternal(HttpContext 上下文, HttpApplicationState 状态,MethodInfo[] 处理程序)+335
这是我尝试从 IIS7 运行时出现的错误...我可以正常运行 似乎没有 VS2008 Cassini ......所以我不确定是什么问题 是,我有 S#arp 和 MVC.Net 1.0 的 7/16/2009 主干构建。这 它失败的一段代码在 global.asax.cs Init() 方法。我真的对这个问题感到非常沮丧,因为我有 只找到了另一篇关于此的帖子,它在测试用例中, 我实际上是在尝试从 iis7 和所有网站运行网站 我的测试通过了。
如果有人知道可能导致此问题的原因,那将是 太好了谢谢。
【问题讨论】:
标签: asp.net-mvc nhibernate s#arp-architecture