System.BadImageFormatException由NUnit的项目引起的 [英] System.BadImageFormatException caused by NUnit project

查看:304
本文介绍了System.BadImageFormatException由NUnit的项目引起的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好日子大家。我一直有同样的问题,整天在工作,我在努力发现新的路径往下走。

Good day everyone. I have been having the same problem all day at work and am struggling to find any new paths to go down.

我收到以下错误,当我的解决方案基于服务器。我没有问题,运行/调试解决方案中的所有测试和它建立的罚款。服务器和我的电脑是64位。我跟了很多意见,我发现没有效果。

I am getting the following error when my solution builds on server. I have no problem running/debugging all tests in the solution and it builds fine. Both server and my PC are x64. I have followed a lot of advice which I have found to no avail.

我已经设置目标平台为x86的在我的下所有配置解决方案的所有项目。

I have set Platform Target to x86 for all projects in my solution under all configurations.

我知道有一个NUnit控制台-x86.exe程序可能使所有的差异,但我不知道在哪里可以在代码中指定。

I am aware that there is an nunit-console-x86.exe which could make all the difference but I'm not sure where to specify this in the code.

请意识到我有线索,开辟了互联网,所以如果道歉我错过了一些东西。

Please realise I have trail-blazed the internet, so apologies if I have missed something.

System.BadImageFormatException:无法加载文件或程序结果
'Spin.TradingServices.DataAcquisition.Test.NUnit,
版= 1.0.12103.2060,文化=中立,公钥=空'或者一个$ b $其依赖乙。试图加载程序与
格式不正确结果
档名:
'Spin.TradingServices.DataAcquisition.Test.NUnit,
版= 1.0。 12103.2060,文化=中立,公钥=空

System.BadImageFormatException: Could not load file or assembly
'Spin.TradingServices.DataAcquisition.Test.NUnit, Version=1.0.12103.2060, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
File name: 'Spin.TradingServices.DataAcquisition.Test.NUnit, Version=1.0.12103.2060, Culture=neutral, PublicKeyToken=null'

服务器堆栈跟踪:在System.Reflection.RuntimeAssembly._nLoad(的AssemblyName文件名,字符串的代码库
,证据assemblySecurity ,RuntimeAssembly
locationHint,StackCrawlMark&安培; stackMark,布尔throwOnFileNotFound,
布尔forIntrospection,布尔suppressSecurityChecks)在System.Reflection.RuntimeAssembly.InternalLoadAssemblyName
(的AssemblyName
assemblyRef,证据assemblySecurity,StackCrawlMark&安培; stackMark,
布尔forIntrospection,布尔suppressSecurityChecks)
在System.Reflection.Assembly.Load(的AssemblyName assemblyRef)
在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
。负载(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)

Server stack trace: at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.Assembly.Load(AssemblyName assemblyRef) 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)

例外重新抛出的[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.ConsoleRunner。在NUnit.ConsoleRunner.Runner.Main ConsoleUi.Execute(ConsoleOptions选项)
(字串[] args)

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.ConsoleRunner.ConsoleUi.Execute(ConsoleOptions options) at NUnit.ConsoleRunner.Runner.Main(String[] args)

警告:程序集绑定日志记录被关闭。要启用程序集绑定失败日志记录,将注册表值
[!HKLM\Software\Microsoft\Fusion EnableLog](DWORD)设置为1。注意:没有
与程序集绑定关联的性能损失失败
记录。要关闭此功能,请移除注册表值
[HKLM\Software\Microsoft\Fusion!EnableLog。

WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

http://app1017-build.oy.gb.sportingindex.com:8080/job/TradingServices.DataAcquisition-Dev/ws/DataAcquisition/build.proj(86,5)
错误MSB6006:NUnit的-console.exe的代码-100退出。完成
楼工程

(缺省目标) - 失败。

http://app1017-build.oy.gb.sportingindex.com:8080/job/TradingServices.DataAcquisition-Dev/ws/DataAcquisition/build.proj(86,5): error MSB6006: "nunit-console.exe" exited with code -100. Done Building Project " (default targets) -- FAILED.

构建失败

请注意::我们已经恢复了建立在哈德森和现在又重新犯逐渐多了起来的文件,我将如何去报到。试图涉足这一个无济于事很遗憾。羞耻了几个头!

PLEASE NOTE: We have reverted our build on Hudson and now re-committing files more gradually. I will report back on how this goes. Tried get a few heads involved on this one to no avail unfortunately. Shame!

更新
我还没有回过此页面一段时间,但它看起来像有很多不同的解决方案。如果我可以将它们都标记为答案我会的!那些你在这里找到自己的方式或许应该给予同等的信贷每个选项。

Update I haven't been back to this page for a while but it looks like there are lots of different solutions. If I could mark them all as the answer I would! Those of you finding your way here should probably give equal credit to each option.

推荐答案

检查您的程序集的目标框架版本是一样NUnit的测试运行支持。
见runFile.exe.config支持的运行时的列表

Check the target framework version of your assembly are same as nUnit test runner supports. See runFile.exe.config for list of supported runtimes.

此外,如果您是从FW 3 megrated至FW 4,它们具有不同的运行时(CLR是不同的)。

Also if you have megrated from FW 3 to FW 4, they has different runtime (CLR is different).

这篇关于System.BadImageFormatException由NUnit的项目引起的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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