问题描述
我正在设置一台新的 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'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!