Hi All,
My .net application is running perfectly until I signed my assemblies and deployed them in GAC. Checking the stack trace I found out that the exception is thrown from this code:
Code:
System.IO.MemoryStream stream = new System.IO.MemoryStream();
NHibernate.Mapping.Attributes.HbmSerializer.Default.Validate = true;
NHibernate.Cfg.Configuration cfg = new NHibernate.Cfg.Configuration();
Hibernate.Mapping.Attributes.HbmSerializer.Default.Serialize(stream, Assembly.Load("AssemblyName, Version=..., Culture=..., PublicKeyToken=..."));
The code above is from one of my signed assemblies that is in GAC. You will notice in that code that I am not using mapping files and just decorated my class with mapping attributes. The innermost exception in the stack trace is this: "Could not load type 'Classname, Namespace', check that type and assembly names are correct", with this message: "persistent class 'Classname, Namespace' not found". Based on that exception, it seems that NHibernate cannot find my assembly in GAC.
I also added qualifyAssembly in my app's config file.