NUnit“无法加载文件或程序集'MyTestProject'

NUnit quot;could not load file or assemby #39;MyTestProject#39;(NUnit“无法加载文件或程序集MyTestProject)
本文介绍了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'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
quot;Overflowquot; compiler error with -9223372036854775808L(编译器错误-9223372036854775808L(Q;溢出Q))
Visual Studio 2010 ReportViewer Assembly References(Visual Studio 2010 ReportViewer程序集引用)
Weird behaviour when I open a reportviewer in WPF(在WPF中打开报表查看器时出现奇怪的行为)
how do i pass parameters to aspnet reportviewer(如何将参数传递给aspnet report查看器)