"Place"클래스와 정수를 반환하는 "Where"클래스로 구성된 .NET DLL이 제공됩니다. DLL을 응용 프로그램 도메인에로드하고 함수를 실행하고 응용 프로그램 도메인을 언로드해야합니다.appdomain에서 함수 실행
'Could not load file or assembly 'Place, Version=1.0.0.0, Culture=neutral, PublicKeyToken-null' or one of it's dependencies. The System Cannot find the specified file.'
파일이 버퍼에, 그래서 나는 그것이 의존성의 .DLL 같은데요 :이 오류 메시지와 함께
Dim asy As Assembly = domain.Load(buffer)
을 :
Dim domain As AppDomain = AppDomain.CreateDomain("Executor")
Dim buffer() As Byte = IO.File.ReadAllBytes("c:\path\Locator.dll")
Dim asy As Assembly = domain.Load(buffer)
Dim obj As [Object] = asy.CreateInstance("Locator.Place")
Dim method As MethodInfo = obj.GetType.GetMethod("Where")
Dim result as Integer = method.Invoke(obj, New [Object]() { 1 })
AppDomain.Unload(domain)
이 줄은 실패합니다. 그러나 기본 프로그램 디렉토리에있는 파일을 찾아야합니다.
오류의 원인에 대한 아이디어가 있으십니까?
어셈블리를 AppDomain으로로드하고, 함수를 Extening 한 다음 AppDomain을 언로드하는 테스트 된 샘플 코드는 만족 스러울 것입니다.
은 (BTW, 내가 검색 좀하고 유용한 샘플을 발견하지 않았습니다.)