Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Yet another "could not load file or assembly ... or one of its dependencies. The system cannot find the file specified"

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.

like image 767
Instance Hunter Avatar asked Oct 01 '09 16:10

Instance Hunter


1 Answers

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

like image 92
Mike Two Avatar answered Sep 27 '22 22:09

Mike Two