2012-03-15 6 views
4

크리스탈 보고서를 만들려고하는데 해당 필드를 처음 사용했습니다. this tutorial post에서 크리스탈 보고서를 만들었지 만 작동하지 않는 것 같습니다.파일 또는 어셈블리 'log4net'또는 해당 종속성 중 하나를로드 할 수 없습니다.

내 오류는 다음과 같습니다

Could not load file or assembly 'log4net' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.BadImageFormatException: Could not load file or assembly 'log4net' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Assembly Load Trace: The following information can be helpful to determine why the assembly 'log4net' could not be loaded.

+0

컴퓨터에 log4net이 설치되어 있습니까? – ChrisF

+0

문제는 log4net이며 Crystal Reports는 아닙니다. log4net dll에 대한 참조를 추가 했습니까? –

+0

아니요. 그럴 필요가 없습니다. 어떻게 도와 줄 수 있는지 모르겠습니다. 감사합니다 – emilios

답변

7

BadFormatImageException은 프로그램이 32 비트 아키텍처 용으로 컴파일되고 64 비트 라이브러리 또는 viceversa를로드하려고 시도 할 때 나타나는 오류입니다. 이 오류에서 log4net (잘 알려진 로그 라이브러리)에 대한 참조가 있습니다.
먼저 경우 응용 프로그램 (86, 64, anycpu를)
둘째는, log4net의 비트 수를 확인을 만드는 CPU의 종류
세 번째를 (당신은 당신의 애플 리케이션의 동일한 비트 수를 참조해야합니다) 확인, 어떤 IIS가 실행 중인지 확인하십시오. (x64 및 응용 프로그램 32의 경우 응용 프로그램 풀의 고급 설정 섹션에서 '32 비트 응용 프로그램 사용'을 true로 설정하십시오.)

1

"시도가 잘못된 형식의 프로그램을로드하려고했습니다." 일부 DLL은 32 비트이고 일부는 64 비트이기 때문일 수 있습니다. 또 다른 이유는 응용 프로그램 서버가 64 비트 용으로 구성되었고 dll은 32 비트 (또는 다른 방법) 일 수 있습니다.

먼저 IIS의 설정을 확인한 다음 (사용중인 IIS의 버전에 따라 다름) dll이 32 비트 또는 64 비트 (myproject 설정에서)로 컴파일되었는지 확인합니다.

관련 문제