Microsoft MVP성태의 닷넷 이야기
오류 유형: 67. ClickOnce 응용 프로그램이 실행되지 않을 때. [링크 복사], [링크+제목 복사]
조회: 29048
글쓴 사람
정성태 (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)
13607정성태4/25/2024188닷넷: 2248.C# - 인터페이스 타입의 다중 포인터를 인자로 갖는 C/C++ 함수 연동
13606정성태4/24/2024203닷넷: 2247. C# - tensorflow 연동 (MNIST 예제)파일 다운로드1
13605정성태4/23/2024392닷넷: 2246. C# - Python.NET을 이용한 파이썬 소스코드 연동파일 다운로드1
13604정성태4/22/2024438오류 유형: 901. Visual Studio - Unable to set the next statement. Set next statement cannot be used in '[Exception]' call stack frames.
13603정성태4/21/2024708닷넷: 2245. C# - IronPython을 이용한 파이썬 소스코드 연동파일 다운로드1
13602정성태4/20/2024801닷넷: 2244. C# - PCM 오디오 데이터를 연속(Streaming) 재생 (Windows Multimedia)파일 다운로드1
13601정성태4/19/2024851닷넷: 2243. C# - PCM 사운드 재생(NAudio)파일 다운로드1
13600정성태4/18/2024884닷넷: 2242. C# - 관리 스레드와 비관리 스레드
13599정성태4/17/2024869닷넷: 2241. C# - WAV 파일의 PCM 사운드 재생(Windows Multimedia)파일 다운로드1
13598정성태4/16/2024893닷넷: 2240. C# - WAV 파일 포맷 + LIST 헤더파일 다운로드2
13597정성태4/15/2024880닷넷: 2239. C# - WAV 파일의 PCM 데이터 생성 및 출력파일 다운로드1
13596정성태4/14/20241071닷넷: 2238. C# - WAV 기본 파일 포맷파일 다운로드1
13595정성태4/13/20241052닷넷: 2237. C# - Audio 장치 열기 (Windows Multimedia, NAudio)파일 다운로드1
13594정성태4/12/20241069닷넷: 2236. C# - Audio 장치 열람 (Windows Multimedia, NAudio)파일 다운로드1
13593정성태4/8/20241084닷넷: 2235. MSBuild - AccelerateBuildsInVisualStudio 옵션
13592정성태4/2/20241219C/C++: 165. CLion으로 만든 Rust Win32 DLL을 C#과 연동
13591정성태4/2/20241199닷넷: 2234. C# - WPF 응용 프로그램에 Blazor App 통합파일 다운로드1
13590정성태3/31/20241079Linux: 70. Python - uwsgi 응용 프로그램이 k8s 환경에서 OOM 발생하는 문제
13589정성태3/29/20241154닷넷: 2233. C# - 프로세스 CPU 사용량을 나타내는 성능 카운터와 Win32 API파일 다운로드1
13588정성태3/28/20241268닷넷: 2232. C# - Unity + 닷넷 App(WinForms/WPF) 간의 Named Pipe 통신 [2]파일 다운로드1
13587정성태3/27/20241170오류 유형: 900. Windows Update 오류 - 8024402C, 80070643
13586정성태3/27/20241337Windows: 263. Windows - 복구 파티션(Recovery Partition) 용량을 늘리는 방법
13585정성태3/26/20241132Windows: 262. PerformanceCounter의 InstanceName에 pid를 추가한 "Process V2"
13584정성태3/26/20241250개발 환경 구성: 708. Unity3D - C# Windows Forms / WPF Application에 통합하는 방법파일 다운로드1
13583정성태3/25/20241472Windows: 261. CPU Utilization이 100% 넘는 경우를 성능 카운터로 확인하는 방법
[1]  2  3  4  5  6  7  8  9  10  11  12  13  14  15  ...