Hi,
I've just tried upgrading our application to NHibernate 2.0.0.Alpha1. The main code works fine, but there is a small bit of legacy web-service code that calls out to a .Net assembly using COM Interop. The host process is dllhost.exe, and the configuration is set through code since there is no .config file.
The error appears to be in Microsoft's XmlSerializer. I can get round the problem by giving IWAM_<machine_name> access to C:\Windows\Temp, but I was wondering if there was a way of configuring NHibernate to avoid the use of temporary files?
Hibernate version: NHibernate-2.0.0.Alpha1
Code between sessionFactory.openSession() and session.close():
Code:
// NHibernate configuration is entered in code rather than using .config files
// because the COM-Interop stuff uses the dllhost.exe.config file in System32.
configuration.Properties.Add(NHibernate.Cfg.Environment.ConnectionProvider, "NHibernate.Connection.DriverConnectionProvider");
configuration.Properties.Add(NHibernate.Cfg.Environment.Dialect, "NHibernate.Dialect.MsSql2005Dialect");
configuration.Properties.Add(NHibernate.Cfg.Environment.ConnectionDriver, "NHibernate.Driver.SqlClientDriver");
configuration.Properties.Add(NHibernate.Cfg.Environment.ConnectionString, m_connectionString);
configuration.AddAssembly(m_nHibernateAssembly);
Full stack trace of any exception that occurs:Code:
NHibernate.MappingException: Could not compile the mapping document: Nhs.Scotland.Domain.User.hbm.xml ---> System.InvalidOperationException: Unable to generate a temporary class (result=1).
error CS2001: Source file 'C:\WINDOWS\TEMP\iyijl-_n.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 ---
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 NHibernate.Cfg.Configuration.AddAssembly(String assemblyName)
Any help/insight would be appreciated.
Thanks,
Richard