【问题标题】:C# xaml System.BadImageFormatExceptionC# xaml System.BadImageFormatException
【发布时间】:2014-10-24 11:23:36
【问题描述】:

我有一个昨天构建并运行良好的 WPF 应用程序。 今天我打开它时,我收到了这个错误:

http://oi61.tinypic.com/vzady8.jpg

这似乎发生在我的 xaml cs 代码运行之前,因为没有断点工作。 我认为这与加载程序集有关。

这是完整的错误,请查看内部异常,因为我认为这是真正的错误:

http://pastebin.com/xUuamwae

这可能与 WindowsBase dll 有关,因为它似乎突出显示了该行,或者可能是导致 WindowsBase 死在这里的内部异常?

内部异常:

InnerException: System.BadImageFormatException
HResult=-2147024885
Message=Could not load file or assembly 
'Cognex.InSight.Controls.Display, 
Version=4.9.2511.0,  Culture=neutral, 
PublicKeyToken=6b9774afddb09935' or one of its dependencies. 
An attempt was made to load a program with an incorrect format.

【问题讨论】:

  • 你见过this吗?
  • 我所有的项目都设置为任何 cpu。我将如何检查 dll 是否设置为任何?该文件的属性似乎没有显示它。谢谢

标签: c# wpf xaml visual-studio-2012


【解决方案1】:

我将项目更改为 x86 并且它工作正常。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-07
    • 1970-01-01
    • 2015-05-10
    相关资源
    最近更新 更多