English 中文(简体)
NHibernatemapException: 无法汇编制图文件
原标题:NHibernate MappingException: Could not compile the mapping document

在我的网络上,NHibernate正在工作。 当我准备和部署这个网站时,我会在创建会议结构时看到一个图象。

这里从痕迹中引出一些信息:

NHibernate.Cfg.Environment 2010-07-15 09:20:59,577 [7] INFO NHibernate.Cfg.Environment [(null)] - NHibernate 2.1.2.4000 (2.1.2.4000) 0.452436832055471 0.232383 NHibernate.Cfg.Environment 2010-07-15 09:20:59,718 [7] INFO NHibernate.Cfg.Environment [(null)] - Bytecode provider name : lcg 0.522780409241957 0.070344 NHibernate.Cfg.Environment 2010-07-15 09:20:59,734 [7] INFO NHibernate.Cfg.Environment [(null)] - Using reflection optimizer 0.529107470362853 0.006327 NHibernate.Cfg.Configuration 2010-07-15 09:20:59,827 [7] INFO NHibernate.Cfg.Configuration [(null)] - Mapping resource: Kctc.BusinessLayer.Mappings.StoredWill.hbm.xml 0.623336485503046 0.094229 NHibernate.Dialect.Dialect 2010-07-15 09:21:00,109 [7] INFO NHibernate.Dialect.Dialect [(null)] - Using dialect: NHibernate.Dialect.MsSql2008Dialect 0.91570185596214 0.292365 NHibernate.Cfg.Configuration 2010-07-15 09:21:01,390 [7] ERROR NHibernate.Cfg.Configuration [(null)] - Could not compile the mapping document: Kctc.BusinessLayer.Mappings.StoredWill.hbm.xml NHibernate.MappingException: Could not compile the mapping document: Kctc.BusinessLayer.Mappings.StoredWill.hbm.xml ---> System.InvalidOperationException: Unable to generate a temporary class (result=1). error CS2001: Source file C:WINDOWSTEMPshp2uoc8.0.cs could not be found error CS2008: No inputs specified

at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, Evidence evidence) at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, XmlSerializerCompilerParameters parameters, Assembly assembly, Hashtable assemblies) at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence) at System.Xml.Serialization.XmlSerializer.GenerateTempAssembly(XmlMapping xmlMapping, Type type, String defaultNamespace) at System.Xml.Serialization.XmlSerializer..ctor(Type type, String defaultNamespace) at System.Xml.Serialization.XmlSerializer..ctor(Type type) at NHibernate.Cfg.XmlHbmBinding.Binder.Deserialize[T](XmlNode node) at NHibernate.Cfg.XmlHbmBinding.MappingRootBinder.Bind(XmlNode node) at NHibernate.Cfg.Configuration.AddValidatedDocument(NamedXmlDocument doc) --- End of inner exception stack trace --- 2.20609881982207 1.290397 Unhandled Execution Error Could not compile the mapping document: Kctc.BusinessLayer.Mappings.StoredWill.hbm.xml at NHibernate.Cfg.Configuration.LogAndThrow(Exception exception) at NHibernate.Cfg.Configuration.AddValidatedDocument(NamedXmlDocument doc) at NHibernate.Cfg.Configuration.ProcessMappingsQueue() at NHibernate.Cfg.Configuration.AddDocumentThroughQueue(NamedXmlDocument document) at NHibernate.Cfg.Configuration.AddXmlReader(XmlReader hbmReader, String name) at NHibernate.Cfg.Configuration.AddInputStream(Stream xmlInputStream, String name) at NHibernate.Cfg.Configuration.AddResource(String path, Assembly assembly) at NHibernate.Cfg.Configuration.AddAssembly(Assembly assembly) at Kctc.BusinessLayer.NHibernateSessionFactory.get_SessionFactory() in C:KctcTrunkKctc.BusinessLayerNHibernateSessionFactory.cs:line 26
at Kctc.BusinessLayer.NHibernateSessionFactory.OpenSession() in C:KctcTrunkKctc.BusinessLayerNHibernateSessionFactory.cs:line 39
at Developers_Test.ListSquirps(Object sender, EventArgs e) at System.Web.UI.WebControls.Button.OnClick(EventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 2.20665643259129 0.000558

这对我来说,或者说,绘图档案有错误,或者无法找到。 但是,如果dev子评估得当,那么当它有预谋和部署时,怎么能够把问题放在绘图档案中?

是否有人建议在此会发生什么?

增 编

最佳回答

Okay, I ve got. 创立时所援引的XmlSerializer类别需要写进(缺席)C:CorteMP,以便它能够在那里产生一些 st子。

或者,你可以跟踪这个博客的黑板:。 http://www.hanselman.com/blog/ChangingWhereXmlSerializerOutputsT InterimAssemblies.aspx。 这改变了XmlSerializer储存其shi子的违约地点。 你们必须做的是,在你的网络配置要素中添加以下内容。

<system.xml.serialization>
  <xmlSerializer tempFilesLocation="C:SomeFolderSomeOtherFolderWhereeverYouWant"/>
</system.xml.serialization>

第一项解决办法被视为一个安全问题,第二项解决办法认为像一个难以预见的后果的cl。

为什么这种记录太少?

问题回答

检查Hhbm.xml文档被定义为贵项目的一个嵌入资源。





相关问题
handling exceptions IN Action Filters

Is there a better way to handle exceptions that occur inside an Action Filter itself in ASP .NET MVC? There re 2 ways I can think of at the moment. Using a try catch and setting the HTTP Status ...

既可捕获,又可举出例外。

我有一种办法,可以进入亚洲开发银行,因此,我国的亚行在多瑙河航道中的所有 st子都位于一个试捕区。 它正在追捕Kexception

Cross compiler exception handling - Can it be done safely?

I am doing some maintenance on a C++ windows dll library that is required to work with different VC++ compilers (as I don’t want to address different mangling schemes). I have already eliminated any ...

File Handling Issue

I am developing a tool in c#, at one instance I start writing into a xml file continuously using my tool,when i suddenly restart my machine the particular xml file gets corrupted, what is the reason ...

Watch a memory location/install data breakpoint from code?

We have a memory overwrite problem. At some point, during the course of our program, a memory location is being overwritten and causing our program to crash. the problem happens only in release mode. ...

Unit Test for Exceptions Message

Is there a simple (Attribute-driven) way to have the following test fail on the message of the exception. [TestMethod()] [ExpectedException(typeof(ArgumentException))] public void ExceptionTestTest() ...

热门标签