2012-08-27 2 views
0

C# 및 system.data.sqlite.dll x64를 사용하여 작성된 WCF 서비스 라이브러리가 있습니다. 빌드 구성은 모든 CPU입니다. 그것은 잘 작동합니다. 하지만 system.data.sqlite.dll을 x86 비트 버전으로 변경하면 모든 CPU 구성에서 성공적으로 빌드되지만 wcf를 실행하면 오류가 발생합니다. x86 빌드 구성에서는 성공적으로 빌드되지만 디버깅 할 때 다음 오류가 발생합니다. wcftestclient를 사용합니다.System.Data.Sqlite.dll 32 비트 64 비트 C#

System.BadImageFormatException: Could not load file or assembly 'file:///C:\Users\lala\Desktop\New folder\New folder\CoreServiceWCF\CoreServiceWCF\CoreServiceWCF2\bin\x86\Debug\VplusCoreServiceWCF.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format. 
File name: 'file:///C:\Users\lala\Desktop\New folder\New folder\CoreServiceWCF\CoreServiceWCF\CoreServiceWCF2\bin\x86\Debug\VplusCoreServiceWCF.dll' 
    at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) 
    at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) 
    at System.Reflection.Assembly.Load(AssemblyName assemblyRef) 
    at Microsoft.Tools.SvcHost.ServiceHostHelper.LoadServiceAssembly(String svcAssemblyPath) 

=== Pre-bind state information === 
LOG: User = lala-PC\lala 
LOG: Where-ref bind. Location = C:\Users\lala\Desktop\New folder\New folder\CoreServiceWCF\CoreServiceWCF\CoreServiceWCF2\bin\x86\Debug\VplusCoreServiceWCF.dll 
LOG: Appbase = file:///C:/Users/lala/Desktop/New folder/New folder/CoreServiceWCF/CoreServiceWCF/CoreServiceWCF2/bin/x86/Debug 
LOG: Initial PrivatePath = NULL 
Calling assembly : (Unknown). 
=== 
LOG: This bind starts in LoadFrom load context. 
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load(). 
LOG: Using application configuration file: C:\Users\lala\Desktop\New folder\New folder\CoreServiceWCF\CoreServiceWCF\CoreServiceWCF2\bin\x86\Debug\VplusCoreServiceWCF.dll.config 
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config. 
LOG: Attempting download of new URL file:///C:/Users/lala/Desktop/New folder/New folder/CoreServiceWCF/CoreServiceWCF/CoreServiceWCF2/bin/x86/Debug/VplusCoreServiceWCF.dll. 
ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated. 

누구든지이 문제를 해결할 수 있도록 도움을 주시겠습니까?

+0

32 및 64 비트 실행 파일 s는 호환되지 않습니다. 32 비트 프로그램은 64 비트 DLL을로드 할 수 없으며 반대의 경우도 마찬가지입니다. 이것은 제 지식으로 보편적 인 제한입니다 (즉, 어떤 플랫폼에서도 작동하지 않을 것입니다). – Wug

+0

예. 내 간단한 질문은 system.data.sqlite.dll 32 비트 버전으로 내 wcf 작업을 얻을 수 없다는 것입니다. – Proceso

답변

0

모든 CPU에 대해 어셈블리가 빌드되면 실행하는 컴퓨터의 최적 구성을 취합니다. 즉, 64 비트 Windows를 사용하는 경우 64 비트 모드로 실행되고 32 비트 모드로 실행됩니다. 그것은 32 비트 Windows에있어, 문제는이 어셈블리로 보인다 : VplusCoreServiceWCF.dll,이 어셈블리의 bitness를 먼저 확인하고 올바른 것이 있는지 (아마도 귀하의 경우 64 비트 임)

편집 : WCF 테스트 클라이언트는 64 비트 모드에서만 실행되므로 32 비트로 강제해야 할 수도 있습니다. 여기에서 필요한 정보를 찾을 수 있습니다. I can't compile a standard "WCF Service Library" in x86 format

+0

VplusCoreServiceWCF.dll은이 wcf 서비스 라이브러리 프로젝트의 빌드 결과입니다. wcftestclient를 사용하여 디버깅하려고하면 위의 오류가 발생합니다. – Proceso

+0

WCF Test Client를 32 비트 모드로 실행하려면 강제로 편집해야합니다. – Rafael

+0

yeagh 그게 정말 도움이 답변을 주셔서 감사합니다 라파엘 :) – Proceso