I have an application that uses NH in its data-access layer. My app
is properly configured for the normal case of being directly
launched. However, I recently created another assembly (an IE add-on)
that references the main assembly, and serves as the execution’s entry
point in a separate process. This satellite assembly references the
main assembly, and depends on it for persisting changes to the
database. The satellite assembly, however, makes no reference of its
own to NH. Nor does it contain any NH configuration data. Due in
part to these circumstances perhaps, a problem occurs when the
satellite assembly attempts to persist changes via the main assembly.
That is, the following exception gets thrown:
{System.IO.FileNotFoundException: Could not find file 'C:\Program Files
\Internet Explorer\hibernate.cfg.xml'.
File name: 'C:\Program Files\Internet Explorer\hibernate.cfg.xml'
at System.IO.__Error.WinIOError(Int32 errorCode, String
maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess
access, Int32 rights, Boolean useRights, FileShare share, Int32
bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String
msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode,
FileAccess access, FileShare share, Int32 bufferSize)
at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials
credentials)
at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String
role, Type ofObjectToReturn)
at System.Xml.XmlTextReaderImpl.OpenUrlDelegate(Object xmlResolver)
at System.Threading.CompressedStack.runTryCode(Object userData)
at
System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup
(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.CompressedStack.Run(CompressedStack
compressedStack, ContextCallback callback, Object state)
at System.Xml.XmlTextReaderImpl.OpenUrl()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlTextReader.Read()
at System.Xml.XmlCharCheckingReader.Read()
at System.Xml.XsdValidatingReader.Read()
at System.Xml.XPath.XPathDocument.LoadFromReader(XmlReader reader,
XmlSpace space)
at System.Xml.XPath.XPathDocument..ctor(XmlReader reader, XmlSpace
space)
at System.Xml.XPath.XPathDocument..ctor(XmlReader reader)
at NHibernate.Cfg.ConfigurationSchema.HibernateConfiguration..ctor
(XmlReader hbConfigurationReader, Boolean fromAppSetting) in c:\CSharp
\NH\nhibernate\src\NHibernate\Cfg\ConfigurationSchema
\HibernateConfiguration.cs:line 46}
So, my question is: can I possibly force NH to look for its
configuration information in the current assembly (from which NH was
directly called), rather than the execution’s entry assembly?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---