Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 915763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:56:32+00:00 2026-05-15T17:56:32+00:00

On my dev web app NHibernate is working just dandy. When I precompile and

  • 0

On my dev web app NHibernate is working just dandy. When I precompile and deploy the site, I get a MappingException when the SessionFactory is created.

Here’s some info from the trace:

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:\WINDOWS\TEMP\shp2uoc8.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:\Kctc\Trunk\Kctc.BusinessLayer\NHibernateSessionFactory.cs:line 26
at Kctc.BusinessLayer.NHibernateSessionFactory.OpenSession() in
C:\Kctc\Trunk\Kctc.BusinessLayer\NHibernateSessionFactory.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

This suggests to me either that the mapping file has an error or could not be found. But if the dev app works fine, how can there be an issue with the mapping file when it is precompiled and deployed?!

Does anyone have any suggestion as to what might be happening here?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T17:56:33+00:00Added an answer on May 15, 2026 at 5:56 pm

    Okay, I’ve got it. The XmlSerializer class which is invoked during the creation of the SessionFactory needs write access to (by default) C:\Windows\TEMP so that it can generate some stuff and whack it in there.

    Alternatively, you can follow the hack on this blog http://www.hanselman.com/blog/ChangingWhereXmlSerializerOutputsTemporaryAssemblies.aspx. This changes the default location that XmlSerializer stores its shiznit. All you have to do is add the following element within the configuration element of your web.config / app.config file:

    <system.xml.serialization>
      <xmlSerializer tempFilesLocation="C:\SomeFolder\SomeOtherFolder\WhereeverYouWant"/>
    </system.xml.serialization>
    

    The first solution feels like a security issue, and the second one feels like a clumsy hack with hard-to-foresee consequences.

    Why is this so poorly documented?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing a site in Visual Web Dev Express, and when I run/debug, I'd
We have a web app deployed in several environments (Dev, QA, etc.) as well
For Web-dev, can the PHP Processor be installed on a regular Windows XP machine,
Why didn't languages such as C end up being using for web dev? Surely
Our Dev team had been developing enterprise web page more than 2 years ago.
I have a web-service that I will be deploying to dev, staging and production.
I wonder if anyone has seen this. I am developing a web app and
I need to quickly wrap some security around an existing ASP.Net 2.0 web app.
dev%40bionic%2Dcomms%2Eco%2Euk I want to turn the above back in to readable text. Can anyone
Dev-cpp comes with an example program Jackpot, which has a GetResults function in it:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.