wolli wrote:
Have you tried: cfg.AddAssembly(fileName); ? Do you get the same error here ?
I have tried AddAssembly(string) with the simple assembly name:
Code:
#AddAssembly(asm.GetName().Name);
FNFException loading file equal to asm.GetName().Name
Code:
#AddAssembly(asm.FulName);
FNFException loading file equal to asm.FullName
Ok, indeed it looks like trying the correct filename might be worth trying even if it isn't supported by the API:
Code:
#AddAssembly(asm.Location);
Alas, this results in a FileLoadException. Inner stack trace:
" at System.Reflection.AssemblyName.nInit(Assembly& assembly, Boolean forIntrospection, Boolean raiseResolveEvent)\r\n at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)\r\n at System.Reflection.Assembly.Load(String assemblyString)\r\n at NHibernate.Cfg.Configuration.AddAssembly(String assemblyName)"
Original inner stack trace for comparison:
" at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)\r\n at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)\r\n at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)\r\n at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)\r\n at System.Reflection.Assembly.Load(String assemblyString)\r\n at NHibernate.Util.ReflectHelper.TypeFromAssembly(AssemblyQualifiedTypeName name, Boolean throwOnError)\r\n at NHibernate.Util.ReflectHelper.ClassForName(String name)\r\n at NHibernate.Cfg.XmlHbmBinding.Binder.ClassForFullNameChecked(String fullName, String errorMessage)"
Vexing...