Microsoft MVP성태의 닷넷 이야기
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 
(연관된 글이 1개 있습니다.)

C/C++ 프로젝트의 시작 프로그램으로 .NET Core EXE를 지정하는 경우 닷넷 디버깅이 안 되는 문제


[2020-06-23 업데이트 - 최신 버전의 비주얼 스튜디오에서 "Managed Only (.NET Core)" 디버깅 옵션이 추가되었습니다.

C/C++ 프로젝트를 DLL로 만든 경우 디버깅을 하려면 속성 창의 Debugging 옵션을 이용해 다음과 같이 환경 구성을 할 수 있습니다.

profiler_project_and_folder_settings_basic.png

그런데 저렇게 외부 EXE 파일 대상으로 .NET Core 프로그램을 지정하는 경우, 예를 들어 다음과 같이,

Command: c:\program files\dotnet\dotnet.exe
Command Arguments: exec "c:\temp\ConsoleApp1\ConsoleApp1\bin\Debug\netcoreapp2.1\ConsoleApp1.dll"
Working Directory: c:\temp\ConsoleApp1\ConsoleApp1\bin\Debug\netcoreapp2.1\

설정하고 "Managed only" 모드로 F5 디버깅을 실행하면 다음과 같은 오류가 발생합니다.

A fatal error has occurred and debugging needs to be terminated. For more details, please see the Microsoft Help and Support web site. HRESULT=0x8000ffff. ErrorCode=0x0.


아마도 .NET Managed Debugger가 대상을 .NET Full Framework으로 인식하고 붙으려는 시도를 하기 때문에 실패하는 것으로 보입니다.

실제로 대상 프로세스를 실행해 두고, "Debug" / "Attach to Process..." 메뉴를 이용해 연결하려는 경우 다음의 5가지 유형이 Managed로 나옵니다.

  • Managed (CoreCLR)
  • Managed (Native compilation)
  • Managed (v3.5, v3.0, v2.0)
  • Managed (v4.6, v4.5, v4.0)
  • Managed Compatibility Mode

이 중에서 CoreCLR 유형으로 연결하면 Managed 코드 디버깅이 가능합니다. 반면 "Managed (v4.6, v4.5, v4.0)"와 같은 걸로 지정하면 디버깅이 안 됩니다. 즉, C/C++ 프로젝트에서의 "Managed only" 모드는 CoreCLR에 대한 배려가 없는 것 같습니다.

어쩔 수 없습니다. ^^ Managed 디버깅을 하고 싶다면 대상 EXE를 만든 프로젝트 기준으로 F5 디버깅을 해야 합니다.




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

[연관 글]






[최초 등록일: ]
[최종 수정일: 8/20/2021]

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

비밀번호

댓글 작성자
 



2019-01-31 11시42분
F5 Debug failed with 0x8000ffff when C/C++ project and .NET Core project is mixed.
; https://developercommunity.visualstudio.com/t/F5-Debug-failed-with-0x8000ffff-when-CC/1357382
정성태

... 61  62  63  64  65  66  67  68  69  [70]  71  72  73  74  75  ...
NoWriterDateCnt.TitleFile(s)
11892정성태5/10/201912534웹: 38. HTTP Cookie의 expires 시간 형식(RFC7231)
11891정성태5/9/201915011.NET Framework: 831. (번역글) .NET Internals Cookbook Part 12 - Memory structure, attributes, handles
11890정성태5/8/201910775개발 환경 구성: 439. "Visual Studio Enterprise is required to execute the test." 메시지와 관련된 코드 기록
11889정성태5/8/201911624개발 환경 구성: 438. mstest, QTAgent의 로그 파일 설정 방법
11888정성태5/8/201926805.NET Framework: 830. C# - 비동기 호출을 취소하는 CancellationToken의 간단한 예제 코드 [1]파일 다운로드1
11887정성태5/8/201913319.NET Framework: 829. C# - yield 문을 사용할 수 있는 메서드의 조건
11886정성태5/7/201912401오류 유형: 534. mstest.exe 실행 시 "Visual Studio Enterprise is required to execute the test." 오류 [2]
11885정성태5/7/20199380오류 유형: 533. mstest.exe 실행 시 "File extension specified '.loadtest' is not a valid test extension." 오류 발생
11884정성태5/5/201913054.NET Framework: 828. C# DLL에서 Win32 C/C++처럼 dllexport 함수를 제공하는 방법 - 두 번째 이야기
11883정성태5/3/201917362.NET Framework: 827. C# - 인터넷 시간 서버로부터 받은 시간을 윈도우에 적용하는 방법파일 다운로드1
11882정성태5/2/201914281.NET Framework: 826. (번역글) .NET Internals Cookbook Part 11 - Various C# riddles파일 다운로드1
11881정성태4/28/201914520오류 유형: 532. .NET Core 프로젝트로 마이그레이션 시 "CS0579 Duplicate 'System.Reflection.AssemblyCompanyAttribute' attribute" 오류 발생
11880정성태4/25/201911219오류 유형: 531. 이벤트 로그 오류 - Task Scheduling Error: m->NextScheduledSPRetry 1547, m->NextScheduledEvent 1547
11879정성태4/24/201916462.NET Framework: 825. (번역글) .NET Internals Cookbook Part 10 - Threads, Tasks, asynchronous code and others파일 다운로드2
11878정성태4/22/201914471.NET Framework: 824. (번역글) .NET Internals Cookbook Part 9 - Finalizers, queues, card tables and other GC stuff파일 다운로드1
11877정성태4/22/201914418.NET Framework: 823. (번역글) .NET Internals Cookbook Part 8 - C# gotchas파일 다운로드1
11876정성태4/21/201914253.NET Framework: 822. (번역글) .NET Internals Cookbook Part 7 - Word tearing, locking and others파일 다운로드1
11875정성태4/21/201914615오류 유형: 530. Visual Studo에서 .NET Core 프로젝트를 열 때 "One or more errors occurred." 오류 발생
11874정성태4/20/201914625.NET Framework: 821. (번역글) .NET Internals Cookbook Part 6 - Object internals파일 다운로드1
11873정성태4/19/201913585.NET Framework: 820. (번역글) .NET Internals Cookbook Part 5 - Methods, parameters, modifiers파일 다운로드1
11872정성태4/17/201914046.NET Framework: 819. (번역글) .NET Internals Cookbook Part 4 - Type members파일 다운로드1
11871정성태4/16/201913905.NET Framework: 818. (번역글) .NET Internals Cookbook Part 3 - Initialization tricks [3]파일 다운로드1
11870정성태4/16/201911574.NET Framework: 817. Process.Start로 실행한 콘솔 프로그램의 출력 결과를 얻는 방법파일 다운로드1
11869정성태4/15/201915421.NET Framework: 816. (번역글) .NET Internals Cookbook Part 2 - GC-related things [2]파일 다운로드2
11868정성태4/15/201913148.NET Framework: 815. CER(Constrained Execution Region)이란?파일 다운로드1
11867정성태4/15/201912175.NET Framework: 814. Critical Finalizer와 SafeHandle의 사용 의미파일 다운로드1
... 61  62  63  64  65  66  67  68  69  [70]  71  72  73  74  75  ...