1

我遇到了这个异常:System.BadImageFormatException was unhandled每当我尝试运行在我的 PC 上编译的程序时。我在笔记本电脑上运行 Okuma PC Sim 软件。
即使我打开并编译 API 附带的 API 测试应用程序,也会发生这种情况。
以下是异常详情:

System.BadImageFormatException was unhandled
  Message= is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)
  Source=thincLathe
  StackTrace:
       at thincLathe.frmMain.Form1_Load(Object sender, EventArgs e)
       at System.Windows.Forms.Form.OnLoad(EventArgs e)
       at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
       at System.Windows.Forms.Control.CreateControl()
       at System.Windows.Forms.Control.WmShowWindow(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
4

1 回答 1

3

请参考http://support.microsoft.com/kb/967163

Long KB short... 更改 VS 中的编译设置。应更改“ANYCPU”设置以匹配目标系统 x86 或 x64。

于 2014-05-19T18:18:39.540 回答