0

PostgreSQL 9.1 と対話 (CRUD) する .Net ベースのコマンド ライン アプリがあります。Nuget を使用して、プロジェクトは現在 NHibernate 3.2.0.4000 と FluentHibenrate 1.3.0.717 を参照しています。

現在、コードは .Net 環境 (Windows XP/7 を意味する) では問題なく動作しますが、Mono (Mono JIT コンパイラ バージョン 2.10.8.1 (Debian 2.10.8.1-1ubuntu2.2)) では、まったく同じ NHibernate 内で TypeLoadException が発生しています。コード (mono 用に何も再コンパイルしませんでした。) 誰かが助けて道を示すことができますか? ありがとう!

ここにスタックトレースがあります

FluentNHibernate.Cfg.FluentConfigurationException: An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail.

 ---> FluentNHibernate.Cfg.FluentConfigurationException: An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail.

 ---> NHibernate.MappingException: Could not compile the mapping document: (XmlDocument) ---> System.TypeInitializationException: An exception was thrown by the type initializer for NHibernate.Dialect.Dialect ---> System.TypeLoadException: Could not load type 'NHibernate.Dialect.Dialect+NoOpViolatedConstraintNameExtracter' from assembly 'NHibernate, Version=3.2.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4'.
  --- End of inner exception stack trace ---
  at NHibernate.Cfg.Configuration.AddDeserializedMapping (NHibernate.Cfg.MappingSchema.HbmMapping mappingDocument, System.String documentFileName) [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at NHibernate.Cfg.Configuration.LogAndThrow (System.Exception exception) [0x00000] in <filename unknown>:0 
  at NHibernate.Cfg.Configuration.AddDeserializedMapping (NHibernate.Cfg.MappingSchema.HbmMapping mappingDocument, System.String documentFileName) [0x00000] in <filename unknown>:0 
  at NHibernate.Cfg.Configuration.AddValidatedDocument (NHibernate.Cfg.NamedXmlDocument doc) [0x00000] in <filename unknown>:0 
  at NHibernate.Cfg.Configuration.ProcessMappingsQueue () [0x00000] in <filename unknown>:0 
  at NHibernate.Cfg.Configuration.AddDocumentThroughQueue (NHibernate.Cfg.NamedXmlDocument document) [0x00000] in <filename unknown>:0 
  at NHibernate.Cfg.Configuration.AddXmlReader (System.Xml.XmlReader hbmReader, System.String name) [0x00000] in <filename unknown>:0 
  at NHibernate.Cfg.Configuration.AddInputStream (System.IO.Stream xmlInputStream, System.String name) [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at FluentNHibernate.Cfg.FluentConfiguration.BuildConfiguration () [0x00000] in <filename unknown>:0 
  at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory () [0x00000] in <filename unknown>:0 


  --- End of inner exception stack trace ---
  at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory () [0x00000] in <filename unknown>:0 
  at MyProj.Repository.FluentNHibernateHelperPostgreSQL.CreateSessionFactory () [0x00000] in <filename unknown>:0 
  at MyProj.Repository.FluentNHibernateHelperPostgreSQL.get_SessionFactory () [0x00000] in <filename unknown>:0 
  at MyProj.Repository.FluentNHibernateHelperPostgreSQL.OpenSession () [0x00000] in <filename unknown>:0 
  at MyProj.Repository.NHibernateSessionHelper.SmartSessionFactory () [0x00000] in <filename unknown>:0 
  at MyProj.Repository.NHibernateSessionHelper.DoAnything (MyProj.Repository.TargetMethod target) [0x00000] in <filename unknown>:0 
  at MyProj.Program+<>c__DisplayClass10.<RetrieveDataDriver>b__a () [0x00000] in <filename unknown>:0 

FluentNHibernateHelperPostgreSQL.CreateSessionFactory () に関連するコードは次のとおりです。

private static ISessionFactory CreateSessionFactory()
  {
      FluentConfiguration fluentConfiguration = Fluently.Configure();
      PostgreSQLConfiguration standard = PostgreSQLConfiguration.Standard;
      FluentConfiguration fluentConfiguration1 = fluentConfiguration.Database(((PersistenceConfiguration<PostgreSQLConfiguration, PostgreSQLConnectionStringBuilder>)standard).ConnectionString((PostgreSQLConnectionStringBuilder c) => c.FromConnectionStringWithKey("ConnectionStringKey")));
      ISessionFactory sessionFactory = fluentConfiguration1.Mappings((MappingConfiguration m) => m.AutoMappings.Add(FluentNHibernateHelperPostgreSQL.CreateAutomappings)).ExposeConfiguration(FluentNHibernateHelperPostgreSQL.BuildSchema).BuildSessionFactory();
      return sessionFactory;
  }
4

1 に答える 1