I'm using NUnit to test my application but it is giving me odd error messages that I have not seen before. I'm at a loss to think what configuration change I have made that would break NUnit. (Or what configuration changes I made at all) The application is new, so these are new unit tests fixtures. I also upgraded to NUnit 2.2.7 in case there was a problem with the previous version (no luck). My application runs okay if I launch it, yet I cannot test it.
Here is the message produced by using the NUnit console through TestDriven.NET:
------ Test started: Assembly: NOsm.Dao.Testing.dll ------<br />
<br />
TestCase 'M:NOsm.Dao.Testing.BookmarkDaoTest.SimpleTest'<br />
failed: Could not load file or assembly 'NOsm.Dao.Testing' or one of its dependencies. An attempt was made to load a program with an incorrect format.<br />
System.BadImageFormatException: Could not load file or assembly 'NOsm.Dao.Testing' or one of its dependencies. An attempt was made to load a program with an incorrect format.<br />
File name: 'NOsm.Dao.Testing'<br />
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)<br />
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)<br />
at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)<br />
at System.Reflection.Assembly.Load(String assemblyString)<br />
at TestDriven.TestRunner.AdaptorTestRunner.Run(ITestListener testListener, ITraceListener traceListener, String assemblyPath, String testPath)<br />
at TestDriven.TestRunner.ThreadTestRunner.Runner.Run()<br />
<br />
WRN: Assembly binding logging is turned OFF.<br />
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.<br />
Note: There is some performance penalty associated with assembly bind failure logging.<br />
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].<br />
<br />
<br />
<br />
0 passed, 1 failed, 0 skipped, took 0.89 seconds.
The code for SimpleTest is:
[Test]
public void SimpleTest()
{
Assert.IsFalse(true);
}
If I use the NUnit GUI I get a slightly different exception:
System.IO.FileNotFoundException...<br />
<br />
Server stack trace: <br />
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)<br />
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)<br />
at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)<br />
at System.AppDomain.Load(String assemblyString)<br />
at NUnit.Core.Builders.TestAssemblyBuilder.Load(String assemblyName)<br />
at NUnit.Core.Builders.TestAssemblyBuilder.Build()<br />
at NUnit.Core.Builders.TestAssemblyBuilder.Build(String testName)<br />
at NUnit.Core.TestSuiteBuilder.Build(String assemblyName, String testName)<br />
at NUnit.Core.SimpleTestRunner.Load(String assemblyName, String testName)<br />
at NUnit.Core.SimpleTestRunner.Load(String assemblyName)<br />
at NUnit.Core.ProxyTestRunner.Load(String assemblyName)<br />
at NUnit.Core.ProxyTestRunner.Load(String assemblyName)<br />
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)<br />
at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)<br />
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)<br />
<br />
Exception rethrown at [0]: <br />
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)<br />
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)<br />
at NUnit.Core.TestRunner.Load(String assemblyName)<br />
at NUnit.Util.TestDomain.Load(String assemblyFileName, String testFixture)<br />
at NUnit.Util.TestLoader.LoadTest(String testName)
Any help would be appreciated.
ColinMackay.net
Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?
-- modified at 8:06 Sunday 26th March, 2006
|