Microsoft MVP성태의 닷넷 이야기
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 

Oracle.ManagedDataAccess.Core - GetTypes 호출 시 "Could not load file or assembly 'System.DirectoryServices.Protocols...'" 오류

Oracle.ManagedDataAccess.Core 2.x 버전에서 GetTypes 메서드 또는 (내부에서 GetTypes 메서드를 호출하는) DefinedTypes 속성을 접근하면,

Assembly asm = typeof(OracleConnection).Assembly;
Type [] types = asm.GetTypes();

// 또는, (내부적으로 GetTypes를 호출하는) DefinedTypes
foreach (Type type in asm.DefinedTypes)
{
    Console.WriteLine(type.FullName);
}

이런 예외가 발생합니다.

Unhandled exception. System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types.
Could not load file or assembly 'System.DirectoryServices.Protocols, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   at System.Reflection.Assembly.GetTypes()
   at Program.Main(String[] args) in C:\...\Console1\Console1\Program.cs:line 10
System.IO.FileNotFoundException: Could not load file or assembly 'System.DirectoryServices.Protocols, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
File name: 'System.DirectoryServices.Protocols, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

혹시나 싶어 ReflectionOnlyLoad로 해봤더니,

Assembly reflectionOnlyAsm = Assembly.ReflectionOnlyLoad(asm.FullName);

지원이 안 되는군요. ^^

Unhandled exception. System.PlatformNotSupportedException: ReflectionOnly loading is not supported on this platform.
   at System.Reflection.Assembly.ReflectionOnlyLoad(String assemblyString)
   at Program.Main(String[] args) in C:\...\Console1\Console1\Program.cs:line 13

어쩔 수 없습니다. 예외 메시지 그대로 "System.DirectoryServices.Protocols" 어셈블리 참조를 nuget으로부터 추가하면 됩니다. 혹은, 최근에 나온 3.x 버전의 Oracle.ManagedDataAccess.Core 패키지로 업그레이드해도 해결이 됩니다.




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]







[최초 등록일: ]
[최종 수정일: 3/21/2022]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




... 16  17  18  19  20  21  22  [23]  24  25  26  27  28  29  30  ...
NoWriterDateCnt.TitleFile(s)
13054정성태5/11/20226880.NET Framework: 2007. C# - 10진수 숫자를 담은 문자열을 숫자로 변환하는 방법 [11]파일 다운로드1
13053정성태5/10/20226529.NET Framework: 2006. C# - GC.KeepAlive 메서드의 역할
13052정성태5/9/20226521.NET Framework: 2005. C# - 생성한 참조 개체가 언제 GC의 정리 대상이 될까요?
13051정성태5/8/20226487.NET Framework: 2004. C# XingAPI - ACF 검색 결과로 구한 CSV 파일을 통해 퀀트 종목 찾기파일 다운로드1
13050정성태5/6/20226537.NET Framework: 2003. C# - COM 개체의 이벤트 핸들러에서 발생하는 예외에 대한 CLR의 특별 대우파일 다운로드1
13049정성태5/6/20225514오류 유형: 811. GoLand - Error: Cannot find package
13048정성태5/6/20226641오류 유형: 810. "ASUS TUF GAMING B550M-PLUS (WI-FI)" 모델에서 블루투스 장치가 인식이 안 되는 문제
13047정성태5/6/20226616오류 유형: 809. Speech Recognition could not start
13046정성태5/5/20226926.NET Framework: 2002. C# XingAPI - ACF 파일을 이용한 퀀트 종목 찾기(t1857)
13045정성태5/5/20226972.NET Framework: 2001. C# XingAPI - 주식 종목에 따른 PBR, PER, ROE 구하는 방법(t3341 예제)
13044정성태5/4/20226424오류 유형: 808. error : clang++ exited with code 127
13043정성태5/3/20226087오류 유형: 807. C# - 닷넷 응용 프로그램에서 Informix DB 사용 시 오류 메시지 정리
13042정성태5/3/20226454.NET Framework: 2000. C# - 닷넷 응용 프로그램에서 Informix DB 사용 방법파일 다운로드1
13041정성태4/28/20226734개발 환경 구성: 642. Informix 데이터베이스 docker 환경 구성
13040정성태4/27/20227239VC++: 156. 비주얼 스튜디오 - Linux C/C++ 프로젝트에서 openssl 링크하는 방법
13039정성태4/27/20228044.NET Framework: 1999. C# - Playwright를 이용한 간단한 브라우저 제어 실습
13038정성태4/26/20225921오류 유형: 806. twine 실행 시 ConfigParser.ParsingError: File contains parsing errors: /root/.pypirc
13037정성태4/25/20226242.NET Framework: 1998. Azure Functions를 사용한 간단한 실습
13036정성태4/24/20226993.NET Framework: 1997. C# - nano 시간을 가져오는 방법 [2]
13035정성태4/22/20227564Windows: 204. Windows 10부터 바뀐 QueryPerformanceFrequency, QueryPerformanceCounter
13034정성태4/21/20226941.NET Framework: 1996. C# XingAPI - 주식 종목에 따른 PBR, PER, ROE, ROA 구하는 방법(t3320, t8430 예제)파일 다운로드1
13033정성태4/18/20227562.NET Framework: 1195. C# - Thread.Yield와 Thread.Sleep(0)의 차이점(?)
13032정성태4/17/20227282오류 유형: 805. Github의 50MB 파일 크기 제한 - warning: GH001: Large files detected. You may want to try Git Large File Storage
13031정성태4/15/20226799.NET Framework: 1194. C# - IdealProcessor와 ProcessorAffinity의 차이점
13030정성태4/15/20226491오류 유형: 804. 정규 표현식 오류 - Quantifier {x,y} following nothing.
13029정성태4/14/20226890Windows: 203. iisreset 후에도 이전에 설정한 전역 환경 변수가 w3wp.exe에 적용되는 문제
... 16  17  18  19  20  21  22  [23]  24  25  26  27  28  29  30  ...