帮助排除故障System.BadImageFormatException: [英] Help troubleshooting System.BadImageFormatException:

查看:271
本文介绍了帮助排除故障System.BadImageFormatException:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

虽然通过.NET 3.5 SP1项目,该项目正在联系本地Web服务的调试,我收到了异常

While debugging through a .NET 3.5 SP1 project which is contacting a local web service, I'm receiving the exception

System.BadImageFormatException:坏级令牌

System.BadImageFormatException: "Bad Class Token"

当然也有关于什么是导致异常没有更多的细节。

Of course there aren't much more details about what's causing the exception.

我可以告诉大家,该方法在哪里发生这种情况,这是在同一个班,因为它的来电,调试未能达到。在方法接触Web服务的调用发生此异常。我有其他的方法与Web服务通信,所以引用还是不错的。

I can tell that the method where this occurs, which is in the same class as it's caller, the debugger fails to reach. This exception occurs on the call of the method that contacts the web service. I do have other methods communicating with the web service, so the reference is good.

<打击>我的单元测试方法,也没有用相同的异常
修正:我的单元测试的方法是成功的,进一步的混乱。

My unit tests for the method are also failing with the same exception.
Correction: my unit tests for the method are successful, furthering the confusion.

有谁知道的一种方式追查这一例外?我已经通过对异常类的文档,这使我相信,组件之一,是在不正确的版本,或者有一个问题,构建读。

Does anyone know of a way to track down this exception? I've read through the documentation on the exception class, which leads me to believe that one of the assemblies is incorrect in its version, or there's an issue with the build.

你会建议在解决该异常哪些其他措施?

What other steps would you suggest in troubleshooting this exception?

推荐答案

事实证明,我得到这个例外,由于MSTest的某些异常。切换到xUnit.net,一切都已经因为罚款。

It turns out that I was getting this exception due to some abnormality in MSTest. Switched over to xUnit.net and everything has been fine since.

这篇关于帮助排除故障System.BadImageFormatException:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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