未处理的异常System.BadImageFormatException

时间:2014-04-08 14:53:20

标签: c# c++ visual-studio winapi

我有两个项目;一个C ++库项目和一个C#windows应用程序。两者都内置于VS2008。现在我必须将它转移到VS2012,但是当我转换并运行它时;应用程序崩溃。

构建配置:

C ++ Project:Win32

C#项目:x86

致电堆栈:

  

ntdll.dll!_ZwRaiseException@12()+ 0x12 bytes
      ntdll.dll! KiUserExceptionDispatcher @ 8()+ 0x2a bytes
      KernelBase.dll!754ab727()
      [下面的框架可能不正确和/或缺失,没有为KernelBase.dll加载符号]
      的Mscorwks.dll!52fa7d1c()
      的Mscorwks.dll!53010dfc()
      的Mscorwks.dll!530bc9f0()
      mscoreei.dll!720ff5a3()
      KernelBase.dll!754b11c4()
      mscoree.dll中!72177efd()
      mscoree.dll中!72177f16()
      mscoree.dll中!72174de3()
      KERNEL32.DLL!751733ca()
      ntdll.dll!
__ RtlUserThreadStart @ 8()+ 0x27 bytes
      ntdll.dll!__ RtlUserThreadStart @ 8()+ 0x1b bytes

输出:

'MyCSharpProject.exe': Loaded 'D:\Source2\Source\Examples\Code     Samples\bin\x86\Debug\MyCSharpProject.exe', No native symbols in symbol file.
    'MyCSharpProject.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file.
    'MyCSharpProject.exe': Loaded 'C:\Windows\SysWOW64\mscoree.dll', Cannot find or open the PDB file.
    'MyCSharpProject.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file.
    'MyCSharpProject.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file.
    'MyCSharpProject.exe': Loaded 'C:\Windows\SysWOW64\advapi32.dll', Cannot find or open the PDB file.
    'MyCSharpProject.exe': Loaded 'C:\Windows\SysWOW64\msvcrt.dll', Cannot find or open the PDB file.
    'MyCSharpProject.exe': Loaded 'C:\Windows\SysWOW64\sechost.dll', Cannot find or open the PDB file.
    'MyCSharpProject.exe': Loaded 'C:\Windows\SysWOW64\rpcrt4.dll', Cannot find or open the PDB file.
    'MyCSharpProject.exe': Loaded 'C:\Windows\SysWOW64\sspicli.dll', Cannot find or open the PDB file.
    'MyCSharpProject.exe': Loaded 'C:\Windows\SysWOW64\cryptbase.dll', Cannot find or open the PDB file.
    'MyCSharpProject.exe': Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscoreei.dll', Cannot find or open the PDB file.
    'MyCSharpProject.exe': Loaded 'C:\Windows\SysWOW64\shlwapi.dll', Cannot find or open the PDB file.
    'MyCSharpProject.exe': Loaded 'C:\Windows\SysWOW64\gdi32.dll', Cannot find or open the PDB file.
    'MyCSharpProject.exe': Loaded 'C:\Windows\SysWOW64\user32.dll', Cannot find or open the PDB file.
    'MyCSharpProject.exe': Loaded 'C:\Windows\SysWOW64\lpk.dll', Cannot find or open the PDB file.
    'MyCSharpProject.exe': Loaded 'C:\Windows\SysWOW64\usp10.dll', Cannot find or open the PDB file.
    'MyCSharpProject.exe': Loaded 'C:\Windows\SysWOW64\imm32.dll', Cannot find or open the PDB file.
    'MyCSharpProject.exe': Loaded 'C:\Windows\SysWOW64\msctf.dll', Cannot find or open the PDB file.
    'MyCSharpProject.exe': Loaded 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll', Cannot find or open the PDB file.
    'MyCSharpProject.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4940_none_d08cc06a442b34fc\msvcr80.dll', Cannot find or open the PDB file.
    'MyCSharpProject.exe': Loaded 'C:\Windows\SysWOW64\shell32.dll', Cannot find or open the PDB file.
    'MyCSharpProject.exe': Loaded 'C:\Windows\SysWOW64\ole32.dll', Cannot find or open the PDB file.
    'MyCSharpProject.exe': Loaded 'C:\Windows\SysWOW64\profapi.dll', Cannot find or open the PDB file.
    'MyCSharpProject.exe': Loaded 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\Culture.dll', Cannot find or open the PDB file.
    'MyCSharpProject.exe': Unloaded 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\Culture.dll'
    'MyCSharpProject.exe': Loaded 'C:\Windows\assembly\NativeImages_v2.0.50727_32\mscorlib\62a0b3e4b40ec0e8c5cfaa0c8848e64a\mscorlib.ni.dll', Cannot find or open the PDB file.
    'MyCSharpProject.exe' (Managed (v2.0.50727)): Loaded 'C:\Windows\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    An unhandled exception of type 'System.BadImageFormatException' occurred in Unknown Module.
    Additional information: Could not load file or assembly 'MyCSharpProject.exe' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

0 个答案:

没有答案