Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NUnit "could not load file or assemby 'MyTestProject'

I'm setting up a new 64 bit machine to run as a build server. When I try to load my NUnit test assembly into NUnit GUI I get the following error.

There is nothing obvious missing, all the dependencies seem to be present. All the DLLs are compiled for the x86 platform.

Using NUnit 2.4.7. I have tried upgrading to 2.4.8 but the same error occurs.

System.IO.FileNotFoundException: Could not load file or assembly 'MyTestProject' or one of it's dependencies. The system cannot find the file specified.

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.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) 
like image 226
NeedHack Avatar asked Dec 30 '08 10:12

NeedHack


1 Answers

The solution was to build the test project for "AnyCPU" instead of 32-bit. I can work around the restriction that made us use 32 bit.

Thank you David and Joe90 for the suggestions. I've certainly learned a couple of new things. fuslogvw.exe is awesome, I didn't previously know it existed.

like image 65
NeedHack Avatar answered Oct 13 '22 01:10

NeedHack