C
colin.mackay
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 ------
TestCase 'M:NOsm.Dao.Testing.BookmarkDaoTest.SimpleTest'
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.
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.
File name: 'NOsm.Dao.Testing'
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
codeBase, Evidence assemblySecurity, Assembly locationHint,
StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean
forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at TestDriven.TestRunner.AdaptorTestRunner.Run(ITestListener
testListener, ITraceListener traceListener, String assemblyPath, String
testPath)
at TestDriven.TestRunner.ThreadTestRunner.Runner.Run()
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind
failure logging.
To turn this feature off, remove the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog].
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...
Server stack trace:
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
codeBase, Evidence assemblySecurity, Assembly locationHint,
StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean
forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
forIntrospection)
at System.AppDomain.Load(String assemblyString)
at NUnit.Core.Builders.TestAssemblyBuilder.Load(String assemblyName)
at NUnit.Core.Builders.TestAssemblyBuilder.Build()
at NUnit.Core.Builders.TestAssemblyBuilder.Build(String testName)
at NUnit.Core.TestSuiteBuilder.Build(String assemblyName, String
testName)
at NUnit.Core.SimpleTestRunner.Load(String assemblyName, String
testName)
at NUnit.Core.SimpleTestRunner.Load(String assemblyName)
at NUnit.Core.ProxyTestRunner.Load(String assemblyName)
at NUnit.Core.ProxyTestRunner.Load(String assemblyName)
at
System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr
md, Object[] args, Object server, Int32 methodPtr, Boolean
fExecuteInContext, Object[]& outArgs)
at
System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle
md, Object[] args, Object server, Int32 methodPtr, Boolean
fExecuteInContext, Object[]& outArgs)
at
System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage
msg, Int32 methodPtr, Boolean fExecuteInContext)
Exception rethrown at [0]:
at
System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
reqMsg, IMessage retMsg)
at
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
msgData, Int32 type)
at NUnit.Core.TestRunner.Load(String assemblyName)
at NUnit.Util.TestDomain.Load(String assemblyFileName, String
testFixture)
at NUnit.Util.TestLoader.LoadTest(String testName)
Any help would be appreciated.
Thanks,
Colin.
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 ------
TestCase 'M:NOsm.Dao.Testing.BookmarkDaoTest.SimpleTest'
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.
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.
File name: 'NOsm.Dao.Testing'
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
codeBase, Evidence assemblySecurity, Assembly locationHint,
StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean
forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at TestDriven.TestRunner.AdaptorTestRunner.Run(ITestListener
testListener, ITraceListener traceListener, String assemblyPath, String
testPath)
at TestDriven.TestRunner.ThreadTestRunner.Runner.Run()
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind
failure logging.
To turn this feature off, remove the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog].
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...
Server stack trace:
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
codeBase, Evidence assemblySecurity, Assembly locationHint,
StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean
forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
forIntrospection)
at System.AppDomain.Load(String assemblyString)
at NUnit.Core.Builders.TestAssemblyBuilder.Load(String assemblyName)
at NUnit.Core.Builders.TestAssemblyBuilder.Build()
at NUnit.Core.Builders.TestAssemblyBuilder.Build(String testName)
at NUnit.Core.TestSuiteBuilder.Build(String assemblyName, String
testName)
at NUnit.Core.SimpleTestRunner.Load(String assemblyName, String
testName)
at NUnit.Core.SimpleTestRunner.Load(String assemblyName)
at NUnit.Core.ProxyTestRunner.Load(String assemblyName)
at NUnit.Core.ProxyTestRunner.Load(String assemblyName)
at
System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr
md, Object[] args, Object server, Int32 methodPtr, Boolean
fExecuteInContext, Object[]& outArgs)
at
System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle
md, Object[] args, Object server, Int32 methodPtr, Boolean
fExecuteInContext, Object[]& outArgs)
at
System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage
msg, Int32 methodPtr, Boolean fExecuteInContext)
Exception rethrown at [0]:
at
System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
reqMsg, IMessage retMsg)
at
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
msgData, Int32 type)
at NUnit.Core.TestRunner.Load(String assemblyName)
at NUnit.Util.TestDomain.Load(String assemblyFileName, String
testFixture)
at NUnit.Util.TestLoader.LoadTest(String testName)
Any help would be appreciated.
Thanks,
Colin.