2017-09-12 59 views
0

从命令行运行我的测试时出现以下错误。我为我的测试环境使用了更加锐利的功能。当我从VS2015跑步时,所有的测试都通过了。但是当我使用nunit framework从命令行运行它们时,配置设置失败。我目前的项目是在.NET 4.6.2。Nhibernate Nunit框架异常

SetUp : System.TypeInitializationException : The type initializer for 'NHibernate.Cfg.Configuration' threw an exception. 
     System.TypeInitializationException : The type initializer for 'NHibernate.LoggerProvider' threw an exception. 
     System.ApplicationException : Unable to instantiate: NHibernate.Log4NetLoggerFactory 
     System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation. 
     System.TypeInitializationException : The type initializer for 'NHibernate.Log4NetLoggerFactory' threw an exception. 
     System.NullReferenceException : Object reference not set to an instance of an object. 
     at NHibernate.Cfg.Configuration.Reset() in C:\Projects\nhibernate-core\src\NHibernate\Cfg\Configuration.cs:line 177 

我从Nhibernate 2.0升级到Nhibernate 4.0时遇到此问题。我能够使用Nhibernate的2.0版本的dll来运行测试。

回答

0

我已更新测试框架构建文件以在最新的nunit.framework.dll上运行测试。 (不是对测试项目的参考)。