2013-08-02 2 views
11

Visual Studio 2005의 32 비트 Windows XP 컴퓨터에서 작성된 C# 응용 프로그램이 있습니다. 응용 프로그램이 Windows XP 컴퓨터에서 제대로 실행되지만 64 비트 Windows에서 실행하려고하면 여기 . NET Framework 오류 (HRESULT 0x8007000B)

enter image description here

는 세부에서 전체 텍스트입니다 : 시작에 7 전문 기계, 나는 다음과 같은 대화 상자를 얻을.

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box. 

************** Exception Text ************** 
System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) 
    at ICSNeoCSharp.IcsNeoDll.icsneoTxMessages(Int32 hObject, IcsSpyMessage& pMsg, Int32 lNetworkID, Int32 lNumMessages) 
    at ICSNeoCSharp.FormDTCApplication.transmitFlowControl(Int32 myArbID) in C:\Documents and Settings\Administrator\Desktop\Adam Stuff ThinkPad\DTC Checker FINAL\frmDTCApp.cs:line 1750 
    at ICSNeoCSharp.FormDTCApplication.flowControlTimer_Tick(Object sender, EventArgs e) in C:\Documents and Settings\Administrator\Desktop\Adam Stuff ThinkPad\DTC Checker FINAL\frmDTCApp.cs:line 5166 
    at System.Windows.Forms.Timer.OnTick(EventArgs e) 
    at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m) 
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) 


************** Loaded Assemblies ************** 
mscorlib 
    Assembly Version: 2.0.0.0 
    Win32 Version: 2.0.50727.5472 (Win7SP1GDR.050727-5400) 
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll 
---------------------------------------- 
DTC Checker V1.0 
    Assembly Version: 1.0.4960.25549 
    Win32 Version: 1.0.4960.25549 
    CodeBase: file:///C:/DTC%20Checker%20V1.0%20R3/DTC%20Checker%20V1.0%20R3.exe 
---------------------------------------- 
System.Windows.Forms 
    Assembly Version: 2.0.0.0 
    Win32 Version: 2.0.50727.5468 (Win7SP1GDR.050727-5400) 
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll 
---------------------------------------- 
System 
    Assembly Version: 2.0.0.0 
    Win32 Version: 2.0.50727.5467 (Win7SP1GDR.050727-5400) 
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll 
---------------------------------------- 
System.Drawing 
    Assembly Version: 2.0.0.0 
    Win32 Version: 2.0.50727.5467 (Win7SP1GDR.050727-5400) 
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll 
---------------------------------------- 
Microsoft.Office.Interop.Excel 
    Assembly Version: 12.0.0.0 
    Win32 Version: 12.0.6600.1000 
    CodeBase: file:///C:/Windows/assembly/GAC/Microsoft.Office.Interop.Excel/12.0.0.0__71e9bce111e9429c/Microsoft.Office.Interop.Excel.dll 
---------------------------------------- 

************** JIT Debugging ************** 
To enable just-in-time (JIT) debugging, the .config file for this 
application or computer (machine.config) must have the 
jitDebugging value set in the system.windows.forms section. 
The application must also be compiled with debugging 
enabled. 

For example: 

<configuration> 
    <system.windows.forms jitDebugging="true" /> 
</configuration> 

When JIT debugging is enabled, any unhandled exception 
will be sent to the JIT debugger registered on the computer 
rather than be handled by this dialog box. 

누구든지이 오류가 발생하여이를 해결하는 데 성공 했습니까? 내 경험에서

+0

당신이 64에서 EXE 또는 솔루션을 실행하고있어? – Arshad

+0

exe. Windows 7 컴퓨터에는 Visual Studio가 없습니다. –

+0

x64 컴퓨터 용 exe를 만들었습니까? – Arshad

답변

13

모든 응용 프로그램이 AnyCPU 용으로 빌드 될 수 있지만 모든 어셈블리가 AnyCPU입니까? 네이티브 코드가 포함 된 네이티브 어셈블리 또는 어셈블리가 있습니까? x86에 대해 빌드 되었습니까?

파일 : /// C : 앱이 64 프로세스로 실행되지만이 있음을 표시한다고 /Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll

이 나에게 말한다 BadImageFormatException의 원인이 될 가능성이있는 AnyCPU 또는 x64가 아닌 어셈블리.

시도 할 수있는 한 가지 방법은 32 비트 명령 프롬프트 (c : \ windows \ SysWow64 \ cmd.exe)에서 응용 프로그램을 실행하여 32 비트 프로세스로 강제 실행하고 작동하는지 확인하는 것입니다. 그것이 작동하면 확실히 AnyCPU가 아닌 어셈블리가 있습니다.

+0

명령 프롬프트에서 실행 해 보았지만 작동하지 않았습니다. 나는 당신이 64 비트로 작동하지 않는 어셈블리를 가지고 뭔가를하고 있다고 생각한다. 어쨌든 64 비트로 32 비트 어셈블리 파일을 실행할 수 있습니까? –

+2

나는이 프로젝트를 x86으로 만들었고 효과가 있었다. –

1

해당 오류의 원인은 닷넷 프레임 워크 버전

당신의 닷넷 프레임 워크 버전 및 업데이트를 확인하고 또한 검사 응용 프로그램의 닷넷 버전.

3

프로젝트 속성 -> 빌드 -> 플랫폼 대상 -> x86이이 문제를 해결할 수 있습니다.

+0

이 내 문제가 해결되었습니다. – Tommix

1

64 비트 64 비트 Windows 7에서 32 비트로 실행되었습니다. MSVCR110.dll 버전 64 비트를 MSVCR110.dll 버전 32 비트로 변경하면 windows/syswov64 폴더로 이동하여 해결했습니다.

(32 비트 앱을 실행해야 할 때마다 dll 32을 다시 넣는 것을 잊지 마세요.)

here (syswov64 폴더에 붙여 넣기 전에 압축 해제) dll 버전을 찾을 수 있습니다.

0

내 발견도 추가하고 싶습니다. 빌드 탭의 프로젝트 속성에서 "32 비트 선호"를 선택 취소하고이 오류가 발생했습니다. 다시 확인한 후에 사라졌습니다. 모든 CPU를 목표로 설정했습니다.

나는 이것이 증상을 해결하는 확실한 해결책은 아니지만 도움이 될 수 있음을 알고 있습니다.

0

나를위한 해결책은 IIS의 응용 프로그램 풀을 변경하는 것이 었습니다. 응용 프로그램 풀 속성을 열고 고급 설정으로 이동 한 다음 "32 비트 응용 프로그램 사용"을 True로 변경합니다. 새 값은 기본값이 False입니다.CPU를 x86으로 설정하여 과거에 문제가 해결되었지만 코드 부분은 "모든 CPU"로 설정되었습니다.

0

가장 일반적인 실수 중 하나는 테스트 프로그램과 래퍼 프로그램을 올바른 플랫폼으로 변경하는 것을 잊어 버리는 것입니다.

enter image description here

(... 당신은 정말 2 이미지에 존재하는 경우 확인해야하지만 64 인이 플랫폼을 보여주는 상단 표시 줄에서) 아래의 이미지

enter image description here

를 참조하십시오

구성 관리자에 올바른 구성이 있는지 확인하십시오. 구성이 C++ dll의 실제 구성과 일치하지 않으면 BadImageFormatException을 제공합니다.

나는 많이 검색 한 후 실수에서 배운 ... 그리고 마지막으로이

관련 문제