*Searched forums a bit on this already*
Hi,
Using NHibernate 1.2. I need to add an assembly with mapping files from a subdirectory of my .exe, not the same directory. I can load the assembly fine doing this:
Code:
string exeName = Application.ExecutablePath;
string folder = Path.Combine(Path.GetDirectoryName(exeName), "SubFusion\\Plugins");
Assembly assembly = Assembly.LoadFrom(folder + "\\" + name+".dll");
config.AddAssembly(assembly);
but NHibernate cannot seem to find the classes referenced in the mapping file here (which is in the assembly).
Code:
<?xml version="1.0"?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="FusionPlugin.Model.ConversationNode, FusionPlugin" table="fusion_quests_conv">
<id name="Guid" type="string">
<column name="guid" sql-type="varchar(64)" not-null="true" />
<generator class="Fusion.FusionIDGenerator, SubFusion" />
</id>
<version name="version" access="field" column="version" type="timestamp" generated="always"/>
</class>
</hibernate-mapping>
It complains with this:
{"persistent class FusionPlugin.Model.ConversationNode, FusionPlugin not found"}
which is weird since I could successfully load the assembly.
Now, it works fine, if the FusionPlugin assembly is in the same directory as the .exe, but since I can load it from the subdirectory, why can't NHibernate find the classes in it already?
I need to have it work from the subdirectory "SubFusion\\Plugins", not the .exe directory.
thank you for tips!
S