문제

퓨전 로더가 경고 나 승인없이 단순히 DLL을 건너 뛰게하는 원인이 있습니까?

명령 줄 애플리케이션 에서이 작업을 수행하려고 할 때

Assembly.LoadFrom("c:\\Deploy\\bin\\WebServices.dll")

나는 이것을 본다 :

"요청 된 유형 중 하나 이상을로드 할 수 없습니다. 자세한 내용은 LoadeRexeceptions 속성을 검색하십시오."

해당 DLL은 Platform.dll에 종속성을 가지지 만 해당 종속성의로드는 실패 하므로이 코드 라인은 예외를 던집니다. Fusion Assembly Loading 메시지를 확인할 때 이것이 내가 보는 것입니다.

=== Pre-bind state information ===
LOG: DisplayName = Platform, Version=9.0.0.0, Culture=neutral, PublicKeyToken=null (Fully-specified)

...

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: No application configuration file found.
LOG: Using machine configuration file from C:\\Windows\\Microsoft.NET\\Framework64\\v2.0.50727\\config\\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Project/bin/Debug/Platform.DLL.
LOG: Attempting download of new URL file:///C:/Project/bin/Debug/Platform/Platform.DLL.
LOG: Attempting download of new URL file:///C:/Project/bin/Debug/Platform.EXE.
LOG: Attempting download of new URL file:///C:/Project/bin/Debug/Platform/Platform.EXE.
LOG: Attempting download of new URL file:///c:/Deploy/bin/Platform.DLL.
LOG: Attempting download of new URL file:///c:/Deploy/bin/Platform/Platform.DLL.
LOG: Attempting download of new URL file:///c:/Deploy/bin/Platform.EXE.
LOG: Attempting download of new URL file:///c:/Deploy/bin/Platform/Platform.EXE.

문제는 DLL입니다 ~이다 참석합니다 c:\Deploy\bin\Platform.DLL, 적절한 버전과 서명 된 공개 키가 없습니다.

내가 생각한 것 :
1. 어쩌면 그것은 실제로 플랫폼의 종속성일지도 모른다. (반사판에서 종속성 트리를 쫓았지만 누락 된 DLL을 찾지 못했습니다)
2. 릴리스/디버그 불일치 또는 64 비트 대 32 비트가 있습니까? 그러나 모든 것이 같은 기계에 만들어졌습니다
3. 어쩌면 나는 통나무를 잘못 읽고 있지만 그것이 찾은 DLL에 부딪 칠 때 멈추지 말아야합니까? 이 로그에서 "성공"또는 "실패한"메시지가 보이지 않습니다. 예외 때문에 실패한 것을 알고 있습니다.

추신 : 더 많은 기술 세부 사항 :
기계 환경은 Windows 2008 64 비트이며 .NET 2.0, 3.0 & 3.5가 설치되어 있습니다.
이 동일한 응용 프로그램은 다른 기계 (Vista 32 비트)에서 잘 작동하지만 동일한 디렉토리 구조와 DLL을 사용하여 해당 시스템에 구축되었습니다.

도움이 되었습니까?

해결책

네, 필요한 DLL을 찾을 때 중지되어야합니다.

그러나 명령 줄 앱은 어디에서 실행됩니까? 디버그 폴더라면 시도해 볼 수있는 몇 가지 사항은

  1. 동일한 폴더에 종속 DLL을 사용하십시오
  2. 다음 형식의 .config 파일을 통해 어셈블리 및 참조에 서명하십시오.

    <dependentAssembly>
        <assemblyIdentity name="WebServices.dll" publicKeyToken="<whatever this public key it>" />
        <codeBase version="1.0.0.0" href="..\WebServices.dll" />
    </dependentAssembly>
    
  3. 그것들을 서명 한 다음 종속 어셈블리를 GAC에 넣으십시오.

나는 벗어날 수도 있지만 그것은 시도해야 할 몇 가지입니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top