NUnit的"无法加载文件或assemby“为MyTestProject” [英] NUnit "could not load file or assemby 'MyTestProject'

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

问题描述

我设立一个新的64位机作为构建服务器上运行。当我尝试加载我NUnit测试组装成NUnit的图形用户界面我得到以下错误。

没有什么明显的缺失,所有的依赖似乎是present。所有的DLL被编译为x86平台。

使用NUnit 2.4.7。我试图升级到2.4.8,但是会出现同样的错误。

  

System.IO.FileNotFoundException:找不到莫非   无法加载文件或程序集   为MyTestProject,或者它的一个   依赖性。系统不能找到   该文件中指定。

System.IO.FileNotFoundException ...

 服务器堆栈跟踪:
   在System.Reflection.Assembly.nLoad(的AssemblyName文件名,字符串codeBase的,证据assemblySecurity,大会locationHint,StackCrawlMark和放大器; stackMark,布尔throwOnFileNotFound,布尔forIntrospection)
   在System.Reflection.Assembly.InternalLoad(的AssemblyName assemblyRef,证据assemblySecurity,StackCrawlMark和放大器; stackMark,布尔forIntrospection)
   在System.Reflection.Assembly.InternalLoad(字符串assemblyString,证据assemblySecurity,StackCrawlMark和放大器; stackMark,布尔forIntrospection)
   在System.Reflection.Assembly.Load(字符串assemblyString)
   在NUnit.Core.Builders.TestAssemblyBuilder.Load(字符串路径)
   在NUnit.Core.Builders.TestAssemblyBuilder.Build(字符串的AssemblyName,布尔autoSuites)
   在NUnit.Core.Builders.TestAssemblyBuilder.Build(字符串的AssemblyName,字符串测试名,布尔autoSuites)
   在NUnit.Core.TestSuiteBuilder.BuildSingleAssembly(TestPackage包)
   在NUnit.Core.TestSuiteBuilder.Build(TestPackage包)
   在NUnit.Core.SimpleTestRunner.Load(TestPackage包)
   在NUnit.Core.ProxyTestRunner.Load(TestPackage包)
   在NUnit.Core.ProxyTestRunner.Load(TestPackage包)
   在NUnit.Core.RemoteTestRunner.Load(TestPackage包)
   在System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr的MD,对象[] ARGS,对象服务器的Int32 methodPtr,布尔fExecuteInContext,对象[]放大器; outArgs)
   在System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(即时聊天味精,的Int32 methodPtr,布尔fExecuteInContext)

异常重新抛出的[0]
   在System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(即时聊天reqMsg,即时聊天retMsg)
   在System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&安培; MSGDATA,的Int32型)
   在NUnit.Core.TestRunner.Load(TestPackage包)
   在NUnit.Util.TestDomain.Load(TestPackage包)
   在NUnit.Util.TestLoader.LoadTest(字符串测试名称)
 

解决方案

解决的办法是建立测试项目为值为anycpu,而不是32位。我可以解决,使我们使用的限制32位。

感谢您大卫和Joe90您的建议。我当然学到了一些新的东西。 fuslogvw.exe是真棒,我没有previously知道它的存在。

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)

解决方案

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.

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

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