title: NHibernate is unable to resolve classes in a dynamically loaded assembly loaded from a subdirectory
body: <p>//Formatting is not properly done.</p>
  
  <p>Using nopcommerce plugins written in nhibernate and .net core, each plugins contains its own entities directory, but when NHibernate configuration fails </p>
  
  <pre><code>var cfg = new Configuration();
  cfg.Configure(CommonHelper.MapPath("~/App_Data/db/defauls.config"));
  // error here
  cfg.AddAssembly("plugins assembly name");
  </code></pre>
  
  <p>FileNotFoundException: Could not load file or assembly '<strong><em>plugins assembly name</em></strong>' or one of its dependencies. The system cannot find the file specified.</p>
  
  <p>System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, string codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, ref StackCrawlMark stackMark, IntPtr pPrivHostBinder, bool throwOnFileNotFound, bool forIntrospection, bool suppressSecurityChecks)
  MappingException: persistent class "<strong><em>plugins assembly name</em></strong>.Entities.class name, <strong><em>plugins assembly name</em></strong> not found</p>
  
  <p>NHibernate.Cfg.XmlHbmBinding.Binder.ClassForFullNameChecked(string fullName, string errorMessage)
  MappingException: Could not compile the mapping document: <strong><em>plugins assembly name</em></strong>.Entities.class name.hbm.xml</p>
  
  <pre><code>NHibernate.Cfg.Configuration.LogAndThrow(Exception exception)
  </code></pre>