6
votes

I have a dll with NUnit tests that had been working fine. I converted it from an Any CPU to an x86 project because I need to use SQLite reliably across different platforms, so I need to include the 32-bit System.Data.SQLite.dll and let everything reference that.

Anyway, after conversion, NUnit gives that error when trying to load the dll.

I don't think this will be enlightening at all, but here is the stack trace:

System.IO.FileNotFoundException: Could not load file or assembly ... or one of its dependencies. The system cannot find the file specified"

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.Reflection.Assembly.Load(String assemblyString)
   at NUnit.Core.Builders.TestAssemblyBuilder.Load(String path)
   at NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName, Boolean autoSuites)
   at NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName, String testName, Boolean autoSuites)
   at NUnit.Core.TestSuiteBuilder.BuildSingleAssembly(TestPackage package)
   at NUnit.Core.TestSuiteBuilder.Build(TestPackage package)
   at NUnit.Core.SimpleTestRunner.Load(TestPackage package)
   at NUnit.Core.ProxyTestRunner.Load(TestPackage package)
   at NUnit.Core.ProxyTestRunner.Load(TestPackage package)
   at NUnit.Core.RemoteTestRunner.Load(TestPackage package)
   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.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(TestPackage package)
   at NUnit.Util.TestDomain.Load(TestPackage package)
   at NUnit.Util.TestLoader.LoadTest(String testName)

The dll I'm trying to test references another one in the same solution. Everything works fine when I run the GUI that this eventually all gets used in, but the tests won't load.

Update

The file that can't be loaded is the assembly under test, which is just MyAppName.Test.dll.

1
May I know what are the files that cannot be loaded? NUnit.Framework.dll? or something else?Graviton
See update. (Darn, we can't use whitespace to reach the character limit any more.)Instance Hunter
Is the reference to NUnit hitting the GAC or does nunit.framework.dll copy locally?Mike Two
Have you tried using the fusion log viewer (fuslogvw.exe) to get more details? msdn.microsoft.com/en-us/library/e74a18c4(VS.71).aspxMike Two
NUnit is copied locally.Instance Hunter

1 Answers

5
votes

Try using the fusion log viewer fuslogvw.exe. It should give you more details about the problem.