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
정성태

... 121  122  123  124  125  126  127  128  129  [130]  131  132  133  134  135  ...
NoWriterDateCnt.TitleFile(s)
1806정성태11/10/201425133.NET Framework: 477. SeCreateGlobalPrivilege 특권과 WCF NamedPipe
1805정성태11/5/201421972.NET Framework: 476. Visual Studio에서 Mono용 Profiler 개발 [3]파일 다운로드1
1804정성태11/5/201428208.NET Framework: 475. ETW(Event Tracing for Windows)를 C#에서 사용하는 방법 [9]파일 다운로드1
1803정성태11/4/201420310오류 유형: 261. Windows Server Backup 오류 - Error in backup of E:\$Extend\$RmMetadata\$TxfLog
1802정성태11/4/201422242오류 유형: 260. 이벤트 로그 - Windows Error Reporting / AEAPPINVW8
1801정성태11/4/201427589오류 유형: 259. 이벤트 로그 - Windows Error Reporting / IPX Assertion / KorIME.exe [1]
1800정성태11/4/201418245오류 유형: 258. 이벤트 로그 - Starting a SMART disk polling operation in Automatic mode.
1799정성태11/4/201423063오류 유형: 257. 이벤트 로그 - The WMI Performance Adapter service entered the stopped state.
1798정성태11/4/201431854오류 유형: 256. 이벤트 로그 - The WinHTTP Web Proxy Auto-Discovery Service service entered the stopped state. [1]
1797정성태11/4/201417540오류 유형: 255. 이벤트 로그 - The Adobe Flash Player Update Service service entered the stopped state.
1796정성태10/30/201424531개발 환경 구성: 249. Visual Studio 2013에서 Mono 컴파일하는 방법
1795정성태10/29/201427034개발 환경 구성: 248. Lync 2013 서버 설치 방법
1794정성태10/29/201422499개발 환경 구성: 247. "Microsoft Office 365 Enterprise E3" 서비스에 대한 간략 소개
1793정성태10/27/201423129.NET Framework: 474. C# - chromiumembedded 사용 - 두 번째 이야기 [2]파일 다운로드1
1792정성태10/27/201423283.NET Framework: 473. WebClient 객체에 쿠키(Cookie)를 사용하는 방법
1791정성태10/22/201423001VC++: 83. G++ - 템플릿 클래스의 iterator 코드 사용에서 발생하는 컴파일 오류 [5]
1790정성태10/22/201418534오류 유형: 254. NETLOGON Service is paused on [... AD Server...]
1789정성태10/22/201421206오류 유형: 253. 이벤트 로그 - The client-side extension could not remove user policy settings for '...'
1788정성태10/22/201423231VC++: 82. COM 프로그래밍에서 HRESULT 타입의 S_FALSE는 실패일까요? 성공일까요? [2]
1787정성태10/22/201431399오류 유형: 252. COM 개체 등록시 0x8002801C 오류가 발생한다면?
1786정성태10/22/201432701디버깅 기술: 65. 프로세스 비정상 종료 시 "Debug Diagnostic Tool"를 이용해 덤프를 남기는 방법 [3]파일 다운로드1
1785정성태10/22/201421938오류 유형: 251. 이벤트 로그 - Load control template file /_controltemplates/TaxonomyPicker.ascx failed [1]
1784정성태10/22/201430025.NET Framework: 472. C/C++과 C# 사이의 메모리 할당/해제 방법파일 다운로드1
1783정성태10/21/201423471VC++: 81. 프로그래밍에서 borrowing의 개념
1782정성태10/21/201420202오류 유형: 250. 이벤트 로그 - Application Server job failed for service instance Microsoft.Office.Server.Search.Administration.SearchServiceInstance
1781정성태10/21/201420633디버깅 기술: 64. new/delete의 짝이 맞는 경우에도 메모리 누수가 발생한다면?
... 121  122  123  124  125  126  127  128  129  [130]  131  132  133  134  135  ...