Microsoft MVP성태의 닷넷 이야기
오류 유형: 67. ClickOnce 응용 프로그램이 실행되지 않을 때. [링크 복사], [링크+제목 복사],
조회: 29060
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 


DeveloperToolManager 프로그램이 다른 PC에서 오류가 발생했습니다. ClickOnce 배포인데 실행하는 시점부터 (윈도우가 보이기도 전에) 오류가 발생해서 DW20.exe가 뜨면서 CPU 100%를 열심히 치는 현상이 발생했습니다. "Attach to process..." 할 여유조차 없는 시간이었습니다.

이벤트 로그에 남는 오류는 다음과 같습니다.

Event Type: Error
Event Source:   .NET Runtime 2.0 Error Reporting
Event Category: None
Event ID:   5000
Date:       2009-02-02
Time:       오후 1:56:37
User:       N/A
Computer:   TestPC
Description:
EventType clr20r3, P1 developertoolmanager.exe, P2 1.0.0.1, P3 497f20d0, 
P4 presentationframework, P5 3.0.0.0, P6 4938d608, P7 625a, P8 e1, 
P9 system.windows.markup.xamlparse, P10 NIL.

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Data:
0000: 63 00 6c 00 72 00 32 00   c.l.r.2.
0008: 30 00 72 00 33 00 2c 00   0.r.3.,.
...[중간 생략]...
0108: 70 00 61 00 72 00 73 00   p.a.r.s.
0110: 65 00 20 00 4e 00 49 00   e. .N.I.
0118: 4c 00 0d 00 0a 00         L.....  

Description에 나오는 내용들은 예전에 설명해 드린 대로 "Watson Bucket" 정보입니다.

Watson Bucket 정보를 이용한 CLR 응용 프로그램 예외 분석
; https://www.sysnet.pe.kr/2/0/595

그런데, 이걸 어쩝니까? 위의 설명대로라면 "presentationframework" 모듈에서 "system.windows.markup.xamlparse" 예외가 발생한 것인데, 이 경우에는 아래에서 설명해 드린 대로 XamlParseException 자체가 그다지 문제 해결에 도움이 되지 않습니다.

WPF - XamlParseException 대응 방법
; https://www.sysnet.pe.kr/2/0/622

사실, 이런 경우에 가장 빨리 문제를 파악할 수 있는 방법은 해당 컴퓨터에 Visual Studio를 설치하고 다음과 같이 레지스트리 키를 등록해서 프로그램 시작 시부터 디버거를 붙이고 "First-chance exception"이 발생하기를 기다리면 됩니다.

HKEY_LOCAL_MACHINE
- SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\DeveloperToolManager.exe
- debugger(REG_SZ): vsjitdebugger

하지만, 언제나 대상 컴퓨터에 Visual Studio가 설치되어 있다고는 장담할 수 없기 때문에 그런 상황을 가정해서 windbg.exe를 만져보기로 했습니다. 정말이지 windbg는 만지고 싶지 않지만 ^^;

우선, 레지스트리 키부터 설정하고,

HKEY_LOCAL_MACHINE
- SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\DeveloperToolManager.exe
- debugger(REG_SZ): C:\Program Files\Debugging Tools for Windows (x86)\windbg.exe

다음의 경로를 통해 ClickOnce로 배포된 응용 프로그램을 실행했습니다.

https://www.sysnet.pe.kr/Tools/DeveloperToolManager.application

windbg.exe가 뜨고, 응용 프로그램이 곧바로 멈춥니다. "g" 키를 눌러서 실행을 계속하니 아래와 같은 예외에서 멈추었습니다.

ModLoad: 77530000 775c7000   C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_5.82.3790.3959_x-ww_78FCF8D0\COMCTL32.dll
ModLoad: 60340000 60348000   C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\culture.dll
ModLoad: 6a320000 6a4db000   C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System.Deployment\a6b58624486714fa71e5e35186850ff0\System.Deployment.ni.dll
(6f0.870): C++ EH exception - code e06d7363 (first chance)
(6f0.870): CLR exception - code e0434f4d (first chance)
(6f0.870): C++ EH exception - code e06d7363 (first chance)
(6f0.870): CLR exception - code e0434f4d (first chance)
(6f0.870): CLR exception - code e0434f4d (first chance)
(6f0.870): CLR exception - code e0434f4d (first chance)
(6f0.870): CLR exception - code e0434f4d (!!! second chance !!!)
eax=0012e6a4 ebx=e0434f4d ecx=00000000 edx=00000028 esi=0012e730 edi=001926c0
eip=77e4bee7 esp=0012e6a0 ebp=0012e6f4 iopl=0         nv up ei pl nz na po nc
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000202
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\WINDOWS\system32\KERNEL32.dll - 
KERNEL32!RaiseException+0x3c:
77e4bee7 5e              pop     esi
0:000>.loadby sos mscorwks

곧바로 sos를 로드하고, 아래와 같이 예외를 출력하도록 했습니다.

0:000> !printexception
Exception object: 01346fac
Exception type: System.Windows.Markup.XamlParseException
Message: Cannot create instance of 'MainWindow' defined in assembly 'DeveloperToolManager, Version=1.0.0.1, Culture=neutral, PublicKeyToken=1591541994228f36'. Exception has been thrown by the target of an invocation.  Error in markup file 'MainWindow.xaml' Line 1 Position 9.
InnerException: System.Reflection.TargetInvocationException, use !PrintException 01331188 to see more
StackTrace (generated):
    SP       IP       Function
    0012E69C 56462C67 PresentationFramework_ni!System.Windows.Markup.XamlParseException.ThrowException(System.String, System.Exception, Int32, Int32, System.Uri, System.Windows.Markup.XamlObjectIds, System.Windows.Markup.XamlObjectIds, System.Type)+0x1bf
    ... [중간 생략] ...
    0012F420 578430CC WindowsBase_ni!System.Windows.Threading.Dispatcher.Run()+0x4c
    0012F42C 55BED47E PresentationFramework_ni!System.Windows.Application.RunDispatcher(System.Object)+0x1e
    0012F438 55BEC77F PresentationFramework_ni!System.Windows.Application.RunInternal(System.Windows.Window)+0x6f
    0012F45C 55BD3A96 PresentationFramework_ni!System.Windows.Application.Run(System.Windows.Window)+0x26
    0012F46C 55BD3A59 PresentationFramework_ni!System.Windows.Application.Run()+0x19
    0012F478 034C00BC DeveloperToolManager!DeveloperToolManager.App.Main()+0x4c

StackTraceString: <none>
HResult: 80131501
There are nested exceptions on this thread. Run with -nested for details

이미, XamlParseException이라는 것도 알고 있으니 넘어가고. 그런데 중간에 보니 InnerException에서 친절하게도 다음 할 일을 알려주고 있습니다. 어쩌겠습니까? 저 같은 초보자는 windbg 님이 하라는 대로 할 수밖에. ^^

0:000> !printexception 01331188
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll - 
Exception object: 01331188
Exception type: System.Reflection.TargetInvocationException
Message: Exception has been thrown by the target of an invocation.
InnerException: System.MissingMethodException, use !PrintException 01325654 to see more
StackTrace (generated):
    SP       IP       Function
    0012E704 792F0047 mscorlib_ni!System.RuntimeType.CreateInstanceSlow(Boolean, Boolean)+0x57
    0012E734 792EFFB7 mscorlib_ni!System.RuntimeType.CreateInstanceImpl(Boolean, Boolean, Boolean)+0xe7
    0012E76C 792F01B4 mscorlib_ni!System.Activator.CreateInstance(System.Type, Boolean)+0x44
    0012E77C 55BFCBC1 PresentationFramework_ni!System.Windows.Markup.BamlRecordReader.CreateInstanceFromType(System.Type, Int16, Boolean)+0x221

StackTraceString: <none>
HResult: 80131604

잉... 이번에도 InnerException이 있네요. 계속 가보기로 하겠습니다.

0:000> !printexception 01325654
Exception object: 01325654
Exception type: System.MissingMethodException
Message: Method not found: 'System.String Tools.Resources.Properties.Resources.get_ApplicationNameVersion()'.
InnerException: <none>
StackTrace (generated):
    SP       IP       Function

StackTraceString: <none>
HResult: 80131513

오호... WPF 응용 프로그램이 참조하고 있는 Tools.Resources.dll 파일에 정의되어 있는 ApplicationNameVersion 정적 멤버 변수를 못 찾고 있는 것입니다.

일단, 이해할 수 없는 현상이군요. 혹시나 싶어, 임시 폴더에 있는 내용들을 모두 정리해보았습니다.

C:\Documents and Settings\[로그인 계정]\Local Settings\Apps\2.0\...[배포 폴더]

음... ^^; 다시 응용 프로그램을 "https://www.sysnet.pe.kr/Tools/DeveloperToolManager.application"에서 접근하니 정상적으로 실행이 되었습니다. 아쉽게도 정확한 예외 상황을 밝혀내지는 못했지만, 이 부분은 나중에도 얼마든지 문제가 될 것 같습니다. 어쩌면, 임시 폴더를 정리하는 응용 프로그램을 만들어야 될지도 모를 것 같다는! ^^

다음에 이런 현상이 있을 때는 좀 더 주의 깊게 살펴봐야 겠습니다. (참고로, 일단 한번 위와 같이 되고 나니 휴지통에서 지웠던 임시 폴더 파일을 복원해도 정상적으로 실행이 되었습니다.)



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







[최초 등록일: ]
[최종 수정일: 6/27/2021]

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

비밀번호

댓글 작성자
 




1  2  3  4  5  6  [7]  8  9  10  11  12  13  14  15  ...
NoWriterDateCnt.TitleFile(s)
13459정성태11/26/20232348닷넷: 2171. .NET Core 3/5+ 기반의 COM Server를 기존의 regasm처럼 등록하는 방법파일 다운로드1
13458정성태11/26/20232370닷넷: 2170. .NET Core/5+ 기반의 COM Server를 tlb 파일을 생성하는 방법(tlbexp)
13457정성태11/25/20232300VS.NET IDE: 187. Visual Studio - 16.9 버전부터 추가된 "Display inline type hints" 옵션
13456정성태11/25/20232622닷넷: 2169. C# - OpenAI를 사용해 PDF 데이터를 대상으로 OpenAI 챗봇 작성 [1]파일 다운로드1
13455정성태11/25/20232503닷넷: 2168. C# - Azure.AI.OpenAI 패키지로 OpenAI 사용파일 다운로드1
13454정성태11/23/20232858닷넷: 2167. C# - Qdrant Vector DB를 이용한 Embedding 벡터 값 보관/조회 (Azure OpenAI) [1]파일 다운로드1
13453정성태11/23/20232342오류 유형: 879. docker desktop 설치 시 "Invalid JSON string. (Exception from HRESULT: 0x83750007)"
13452정성태11/22/20232447닷넷: 2166. C# - Azure OpenAI API를 이용해 사용자가 제공하는 정보를 대상으로 검색하는 방법파일 다운로드1
13451정성태11/21/20232577닷넷: 2165. C# - Azure OpenAI API를 이용해 ChatGPT처럼 동작하는 콘솔 응용 프로그램 제작파일 다운로드1
13450정성태11/21/20232384닷넷: 2164. C# - Octokit을 이용한 GitHub Issue 검색파일 다운로드1
13449정성태11/21/20232491개발 환경 구성: 688. Azure OpenAI 서비스 신청 방법
13448정성태11/20/20232784닷넷: 2163. .NET 8 - Dynamic PGO를 결합한 성능 향상파일 다운로드1
13447정성태11/16/20232657닷넷: 2162. ASP.NET Core 웹 사이트의 SSL 설정을 코드로 하는 방법
13446정성태11/16/20232608닷넷: 2161. .NET Conf 2023 - Day 1 Blazor 개요 정리
13445정성태11/15/20232920Linux: 62. 리눅스/WSL에서 CA 인증서를 저장하는 방법
13444정성태11/15/20232668닷넷: 2160. C# 12 - Experimental 특성 지원
13443정성태11/14/20232715개발 환경 구성: 687. OpenSSL로 생성한 사용자 인증서를 ASP.NET Core 웹 사이트에 적용하는 방법
13442정성태11/13/20232506개발 환경 구성: 686. 비주얼 스튜디오로 실행한 ASP.NET Core 사이트를 WSL 2 인스턴스에서 https로 접속하는 방법
13441정성태11/12/20232823닷넷: 2159. C# - ASP.NET Core 프로젝트에서 서버 Socket을 직접 생성하는 방법파일 다운로드1
13440정성태11/11/20232456Windows: 253. 소켓 Listen 시 방화벽의 Public/Private 제어 기능이 비활성화된 경우
13439정성태11/10/20233014닷넷: 2158. C# - 소켓 포트를 미리 시스템에 등록/예약해 사용하는 방법(Port Exclusion Ranges)파일 다운로드1
13438정성태11/9/20232601닷넷: 2157. C# - WinRT 기능을 이용해 윈도우에서 실행 중인 Media App 제어
13437정성태11/8/20232786닷넷: 2156. .NET 7 이상의 콘솔 프로그램을 (dockerfile 없이) 로컬 docker에 배포하는 방법
13436정성태11/7/20232998닷넷: 2155. C# - .NET 8 런타임부터 (Reflection 없이) 특성을 이용해 public이 아닌 멤버 호출 가능
13435정성태11/6/20232934닷넷: 2154. C# - 네이티브 자원을 포함한 관리 개체(예: 스레드)의 GC 정리
13434정성태11/1/20232722스크립트: 62. 파이썬 - class의 정적 함수를 동적으로 교체
1  2  3  4  5  6  [7]  8  9  10  11  12  13  14  15  ...