细节问题:NHibernate,NUnit and MVC 遇到问题和解决
最近一个项目,用到了这几个,以前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加入。
浙公网安备 33010602011771号