每当我尝试运行在我的电脑上编译的程序时,我都会遇到此异常: System.BadImageFormatException was unhandled
。我在笔记本电脑上运行Okuma PC Sim软件
即使我打开并编译API附带的API Test应用程序,也会发生这种情况
以下是例外情况:
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)
答案 0 :(得分:3)
请参考http://support.microsoft.com/kb/967163
Long KB short ...更改VS中的编译设置。 " ANYCPU"应更改设置以匹配目标系统x86或x64。