Run nhibernate on macOS X 10.13.3 (c#)

Asked

Viewed 38 times

0

Good morning, I’m new to the world of C# programming and therefore had some problems compiling a project by visual studio for mac. The problem was this, the project uses version 4.0.3 of nhibernate to make the database persistence, and when compiling displays the following error to me:

    Unhandled Exception:
System.TypeInitializationException: The type initializer for 'mweb.bot.Program' threw an exception. ---> System.ArgumentNullException: Value cannot be null.
Parameter name: type
  at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) [0x00003] in /Users/builder/data/lanes/5533/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/activator.cs:192 
  at NHibernate.AdoNet.SqlClientSqlCommandSet..ctor () [0x00006] in <d1bed2f218f24e45a019c5c80a004c83>:0 
  at NHibernate.AdoNet.SqlClientBatchingBatcher.CreateConfiguredBatch () [0x00000] in <d1bed2f218f24e45a019c5c80a004c83>:0 
  at NHibernate.AdoNet.SqlClientBatchingBatcher..ctor (NHibernate.AdoNet.ConnectionManager connectionManager, NHibernate.IInterceptor interceptor) [0x00034] in <d1bed2f218f24e45a019c5c80a004c83>:0 
  at NHibernate.AdoNet.SqlClientBatchingBatcherFactory.CreateBatcher (NHibernate.AdoNet.ConnectionManager connectionManager, NHibernate.IInterceptor interceptor) [0x00000] in <d1bed2f218f24e45a019c5c80a004c83>:0 
  at NHibernate.AdoNet.ConnectionManager..ctor (NHibernate.Engine.ISessionImplementor session, System.Data.IDbConnection suppliedConnection, NHibernate.ConnectionReleaseMode connectionReleaseMode, NHibernate.IInterceptor interceptor) [0x00034] in <d1bed2f218f24e45a019c5c80a004c83>:0 
  at NHibernate.Impl.SessionImpl..ctor (System.Data.IDbConnection connection, NHibernate.Impl.SessionFactoryImpl factory, System.Boolean autoclose, System.Int64 timestamp, NHibernate.IInterceptor interceptor, NHibernate.EntityMode entityMode, System.Boolean flushBeforeCompletionEnabled, System.Boolean autoCloseSessionEnabled, System.Boolean ignoreExceptionBeforeTransactionCompletion, NHibernate.ConnectionReleaseMode connectionReleaseMode) [0x000aa] in <d1bed2f218f24e45a019c5c80a004c83>:0 
  at NHibernate.Impl.SessionFactoryImpl.OpenSession (System.Data.IDbConnection connection, System.Boolean autoClose, System.Int64 timestamp, NHibernate.IInterceptor sessionLocalInterceptor) [0x00049] in <d1bed2f218f24e45a019c5c80a004c83>:0 
  at NHibernate.Impl.SessionFactoryImpl.OpenSession (NHibernate.IInterceptor sessionLocalInterceptor) [0x0001f] in <d1bed2f218f24e45a019c5c80a004c83>:0 
  at NHibernate.Impl.SessionFactoryImpl.OpenSession () [0x00000] in <d1bed2f218f24e45a019c5c80a004c83>:0 
  at mweb.dao.ContextoHQL`1[T].ObterSessao () [0x0001d] in /Users/gaignoux/Documents/GitHub/MWeb/mweb.dao/ContextoHQL.cs:65 
  at mweb.dao.EmpresaDAO..ctor () [0x00000] in Users/gaignoux/Documents/GitHub/MWeb/mweb.dao/EmpresaDAO.cs:12 
  at mweb.bot.Program..cctor () [0x00010] in /Users/gaignoux/Documents/GitHub/MWeb/mweb.bot/Program.cs:23 
   --- End of inner exception stack trace ---

[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for 'mweb.bot.Program' threw an exception. ---> System.ArgumentNullException: Value cannot be null.
Parameter name: type
  at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) [0x00003] in /Users/builder/data/lanes/5533/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/activator.cs:192 
  at NHibernate.AdoNet.SqlClientSqlCommandSet..ctor () [0x00006] in <d1bed2f218f24e45a019c5c80a004c83>:0 
  at NHibernate.AdoNet.SqlClientBatchingBatcher.CreateConfiguredBatch () [0x00000] in <d1bed2f218f24e45a019c5c80a004c83>:0 
  at NHibernate.AdoNet.SqlClientBatchingBatcher..ctor (NHibernate.AdoNet.ConnectionManager connectionManager, NHibernate.IInterceptor interceptor) [0x00034] in <d1bed2f218f24e45a019c5c80a004c83>:0 
  at NHibernate.AdoNet.SqlClientBatchingBatcherFactory.CreateBatcher (NHibernate.AdoNet.ConnectionManager connectionManager, NHibernate.IInterceptor interceptor) [0x00000] in <d1bed2f218f24e45a019c5c80a004c83>:0 
  at NHibernate.AdoNet.ConnectionManager..ctor (NHibernate.Engine.ISessionImplementor session, System.Data.IDbConnection suppliedConnection, NHibernate.ConnectionReleaseMode connectionReleaseMode, NHibernate.IInterceptor interceptor) [0x00034] in <d1bed2f218f24e45a019c5c80a004c83>:0 
  at NHibernate.Impl.SessionImpl..ctor (System.Data.IDbConnection connection, NHibernate.Impl.SessionFactoryImpl factory, System.Boolean autoclose, System.Int64 timestamp, NHibernate.IInterceptor interceptor, NHibernate.EntityMode entityMode, System.Boolean flushBeforeCompletionEnabled, System.Boolean autoCloseSessionEnabled, System.Boolean ignoreExceptionBeforeTransactionCompletion, NHibernate.ConnectionReleaseMode connectionReleaseMode) [0x000aa] in <d1bed2f218f24e45a019c5c80a004c83>:0 
  at NHibernate.Impl.SessionFactoryImpl.OpenSession (System.Data.IDbConnection connection, System.Boolean autoClose, System.Int64 timestamp, NHibernate.IInterceptor sessionLocalInterceptor) [0x00049] in <d1bed2f218f24e45a019c5c80a004c83>:0 
  at NHibernate.Impl.SessionFactoryImpl.OpenSession (NHibernate.IInterceptor sessionLocalInterceptor) [0x0001f] in <d1bed2f218f24e45a019c5c80a004c83>:0 
  at NHibernate.Impl.SessionFactoryImpl.OpenSession () [0x00000] in <d1bed2f218f24e45a019c5c80a004c83>:0 
  at mweb.dao.ContextoHQL`1[T].ObterSessao () [0x0001d] in /Users/gaignoux/Documents/GitHub/MWeb/mweb.dao/ContextoHQL.cs:65 
  at mweb.dao.EmpresaDAO..ctor () [0x00000] in /Users/gaignoux/Documents/GitHub/MWeb/mweb.dao/EmpresaDAO.cs:12 
  at mweb.bot.Program..cctor () [0x00010] in /Users/gaignoux/Documents/GitHub/MWeb/mweb.bot/Program.cs:23 
   --- End of inner exception stack trace ---

Has anyone ever had a problem like that?

  • "the parameter type cannot be null"

  • I was able to solve it now, from this topic here: https://stackoverflow.com/questions/45439946/error-500-while-running-a-fluent-nhibernate-project-with-visual-studio-2015-for

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.