NUnit“无法加载文件或程序集‘MyTestProject’ [英] NUnit "could not load file or assemby 'MyTestProject'

查看:27
本文介绍了NUnit“无法加载文件或程序集‘MyTestProject’的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在设置一台新的 64 位机器作为构建服务器运行.当我尝试将 NUnit 测试程序集加载到 NUnit GUI 时,出现以下错误.

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.

没有什么明显的缺失,所有的依赖似乎都存在.所有的 DLL 都是为 x86 平台编译的.

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

使用 NUnit 2.4.7.我尝试升级到 2.4.8,但出现同样的错误.

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

System.IO.FileNotFoundException:可以不加载文件或程序集'MyTestProject' 或其中之一依赖关系.系统找不到指定的文件.

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...

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)

推荐答案

解决方案是为AnyCPU"而不是 32 位构建测试项目.我可以解决导致我们使用 32 位的限制.

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.

感谢 David 和 Joe90 的建议.我当然学到了一些新东西.fuslogvw.exe 很棒,我以前不知道它存在.

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.

这篇关于NUnit“无法加载文件或程序集‘MyTestProject’的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆