最近一个项目,用到了这几个,以前QuickStart过,基本属于初学,遇到问题难免,记录下来,可能对自己和他人有些帮助。

NUnit的问题,我下载了最新的2.5.0.8258版alpha-3,调试一个简单的NHibernate项目,总是报错,各种各样的,这是其中一个

 

***** FirstSolution.Tests.GenerateSchema_Fixture.Can_generate_schema
12:46:05,109 ERROR [TestRunnerThread] ReflectHelper [(null)]- Could not load type NHibernate.Driver.SqlClient.
System.TypeLoadException: Could not load type NHibernate.Driver.SqlClient. Possible cause: no assembly name specified.

   在 NHibernate.Util.ReflectHelper.TypeFromAssembly(AssemblyQualifiedTypeName name, Boolean throwOnError)

 

找了半天,也添加了无数的引用,但是都没有解决。后来发现打开以前保存过的.nunit文件就可以通过,于是发现他们是不同的。

 

<NUnitProject>
  <Settings activeconfig="Debug" />
  <Config name="Debug" appbase="bin\Debug" configfile="NHibernate.Examples.dll.config" binpathtype="Auto">
    <assembly path="NHibernate.Examples.dll" />
  </Config>
  <Config name="Release" appbase="bin\Release" configfile="NHibernate.Examples.dll.config" binpathtype="Auto">
    <assembly path="NHibernate.Examples.dll" />
  </Config>
</NUnitProject>

其中的

configfile="NHibernate.Examples.dll.config"

在我的新项目文件中没有。

解决方法:手动加入或者Edit加入。

相关文章:

  • 2021-11-07
  • 2021-11-07
  • 2021-09-25
  • 2022-01-04
  • 2021-12-21
  • 2021-05-19
  • 2021-10-20
  • 2021-11-17
猜你喜欢
  • 2022-12-23
  • 2021-10-08
  • 2022-12-23
  • 2022-12-23
  • 2021-09-19
  • 2022-12-23
  • 2022-02-06
相关资源
相似解决方案