Microsoft MVP성태의 닷넷 이야기
오류 유형: 67. ClickOnce 응용 프로그램이 실행되지 않을 때. [링크 복사], [링크+제목 복사],
조회: 29090
글쓴 사람
정성태 (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)
13440정성태11/11/20232521Windows: 253. 소켓 Listen 시 방화벽의 Public/Private 제어 기능이 비활성화된 경우
13439정성태11/10/20233117닷넷: 2158. C# - 소켓 포트를 미리 시스템에 등록/예약해 사용하는 방법(Port Exclusion Ranges)파일 다운로드1
13438정성태11/9/20232684닷넷: 2157. C# - WinRT 기능을 이용해 윈도우에서 실행 중인 Media App 제어
13437정성태11/8/20232863닷넷: 2156. .NET 7 이상의 콘솔 프로그램을 (dockerfile 없이) 로컬 docker에 배포하는 방법
13436정성태11/7/20233126닷넷: 2155. C# - .NET 8 런타임부터 (Reflection 없이) 특성을 이용해 public이 아닌 멤버 호출 가능
13435정성태11/6/20233022닷넷: 2154. C# - 네이티브 자원을 포함한 관리 개체(예: 스레드)의 GC 정리
13434정성태11/1/20232789스크립트: 62. 파이썬 - class의 정적 함수를 동적으로 교체
13433정성태11/1/20232488스크립트: 61. 파이썬 - 함수 오버로딩 미지원
13432정성태10/31/20232562오류 유형: 878. 탐색기의 WSL 디렉터리 접근 시 "Attempt to access invalid address." 오류 발생
13431정성태10/31/20232957스크립트: 60. 파이썬 - 비동기 FastAPI 앱을 gunicorn으로 호스팅
13430정성태10/30/20232799닷넷: 2153. C# - 사용자가 빌드한 ICU dll 파일을 사용하는 방법
13429정성태10/27/20233067닷넷: 2152. Win32 Interop - C/C++ DLL로부터 이중 포인터 버퍼를 C#으로 받는 예제파일 다운로드1
13428정성태10/25/20233171닷넷: 2151. C# 12 - ref readonly 매개변수
13427정성태10/18/20233348닷넷: 2150. C# 12 - 정적 문맥에서 인스턴스 멤버에 대한 nameof 접근 허용(Allow nameof to always access instance members from static context)
13426정성태10/13/20233491스크립트: 59. 파이썬 - 비동기 호출 함수(run_until_complete, run_in_executor, create_task, run_in_threadpool)
13425정성태10/11/20233257닷넷: 2149. C# - PLinq의 Partitioner<T>를 이용한 사용자 정의 분할파일 다운로드1
13423정성태10/6/20233248스크립트: 58. 파이썬 - async/await 기본 사용법
13422정성태10/5/20233400닷넷: 2148. C# - async 유무에 따른 awaitable 메서드의 병렬 및 예외 처리
13421정성태10/4/20233491닷넷: 2147. C# - 비동기 메서드의 async 예약어 유무에 따른 차이
13420정성태9/26/20235803스크립트: 57. 파이썬 - UnboundLocalError: cannot access local variable '...' where it is not associated with a value
13419정성태9/25/20233286스크립트: 56. 파이썬 - RuntimeError: dictionary changed size during iteration
13418정성태9/25/20234008닷넷: 2146. C# - ConcurrentDictionary 자료 구조의 동기화 방식
13417정성태9/19/20233543닷넷: 2145. C# - 제네릭의 형식 매개변수에 속한 (매개변수를 가진) 생성자를 호출하는 방법
13416정성태9/19/20233311오류 유형: 877. redis-py - MISCONF Redis is configured to save RDB snapshots, ...
13415정성태9/18/20233812닷넷: 2144. C# 12 - 컬렉션 식(Collection Expressions)
13414정성태9/16/20233599디버깅 기술: 193. Windbg - ThreadStatic 필드 값을 조사하는 방법
1  2  3  4  5  6  7  [8]  9  10  11  12  13  14  15  ...