상황로드 어셈블리
파일에서 모든 모듈 (EXE 파일) 어셈블리를로드 오류가이 어셈블리의 필요한 참조가 발견되지 occours있다. Windows 탐색기에서 어셈블리를 시작하면 모든 것이 잘 동작합니다.
하위 폴더에 있기 때문에 필요한 참조에 문제가있는 것으로 보입니다.
이 구조는
..\MainApplication.exe
..\Plugins\Plugin01.exe (needs Interactivity.dll)
..\Plugins\Interactivity.dll
질문처럼 보인다
필요한 Interactivity.dll 참조가 기본 응용 프로그램의 루트 폴더에 있지만 같은 폴더에 있지 않은지 확인하는 방법 플러그인?
코드 샘플
희미한 TAssembly System.Reflection.Assembly으로 TAssembly = System.Reflection.Assembly.LoadFrom ("C : \ MyProject를 \ 플러그인 \ Plugin01.exe")
원래 오류 메시지
{"Zeilennummer \"33\" und Zeilenposition \"18\" von \"Bei der Initialisierung von
\"Microsoft.Windows.Controls.Ribbon.RibbonApplicationMenu\"
wurde eine Ausnahme ausgelöst.\"."}
Die Datei oder Assembly "Microsoft.Windows.Shell, PublicKeyToken=31bf3856ad364e35"
oder eine Abhängigkeit davon wurde nicht gefunden.
Das System kann die angegebene Datei nicht finden.
정적'AppDomain.CurrentDomain.AssemblyResolve' 이벤트 –
흥미 롭습니다. 알다시피,'AppDomain.CurrentDomain.AssemblyResolve'에는 경로를 변경하지 않아도 어셈블리의 로딩 이벤트를 catch 할 수 있습니다. – Nasenbaer
해당 이벤트에서 어셈블리를로드하고 반환 할 수 있습니다. –