Microsoft MVP성태의 닷넷 이야기
오류 유형: 67. ClickOnce 응용 프로그램이 실행되지 않을 때. [링크 복사], [링크+제목 복사]
조회: 29054
글쓴 사람
정성태 (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)
13510정성태1/3/20242107닷넷: 2192. C# - 특정 실행 파일이 있는지 확인하는 방법 (Linux)
13509정성태1/3/20242147오류 유형: 887. .NET Core 2 이하의 프로젝트에서 System.Runtime.CompilerServices.Unsafe doesn't support netcoreapp2.0.
13508정성태1/3/20242171오류 유형: 886. ORA-28000: the account is locked
13507정성태1/2/20242832닷넷: 2191. C# - IPGlobalProperties를 이용해 netstat처럼 사용 중인 Socket 목록 구하는 방법파일 다운로드1
13506정성태12/29/20232397닷넷: 2190. C# - 닷넷 코어/5+에서 달라지는 System.Text.Encoding 지원
13505정성태12/27/20232954닷넷: 2189. C# - WebSocket 클라이언트를 닷넷으로 구현하는 예제 (System.Net.WebSockets)파일 다운로드1
13504정성태12/27/20232527닷넷: 2188. C# - ASP.NET Core SignalR로 구현하는 채팅 서비스 예제파일 다운로드1
13503정성태12/27/20232388Linux: 67. WSL 환경 + mlocate(locate) 도구의 /mnt 디렉터리 검색 문제
13502정성태12/26/20232492닷넷: 2187. C# - 다른 프로세스의 환경변수 읽는 예제파일 다운로드1
13501정성태12/25/20232300개발 환경 구성: 700. WSL + uwsgi - IPv6로 바인딩하는 방법
13500정성태12/24/20232366디버깅 기술: 194. Windbg - x64 가상 주소를 물리 주소로 변환
13498정성태12/23/20233055닷넷: 2186. 한국투자증권 KIS Developers OpenAPI의 C# 래퍼 버전 - eFriendOpenAPI NuGet 패키지
13497정성태12/22/20232457오류 유형: 885. Visual Studiio - error : Could not connect to the remote system. Please verify your connection settings, and that your machine is on the network and reachable.
13496정성태12/21/20232438Linux: 66. 리눅스 - 실행 중인 프로세스 내부의 환경변수 설정을 구하는 방법 (gdb)
13495정성태12/20/20232407Linux: 65. clang++로 공유 라이브러리의 -static 옵션 빌드가 가능할까요?
13494정성태12/20/20232555Linux: 64. Linux 응용 프로그램의 (C++) so 의존성 줄이기(ReleaseMinDependency) - 두 번째 이야기
13493정성태12/19/20232636닷넷: 2185. C# - object를 QueryString으로 직렬화하는 방법
13492정성태12/19/20232320개발 환경 구성: 699. WSL에 nopCommerce 예제 구성
13491정성태12/19/20232266Linux: 63. 리눅스 - 다중 그룹 또는 사용자를 리소스에 권한 부여
13490정성태12/19/20232390개발 환경 구성: 698. Golang - GLIBC 의존을 없애는 정적 빌드 방법
13489정성태12/19/20232172개발 환경 구성: 697. GoLand에서 ldflags 지정 방법
13488정성태12/18/20232103오류 유형: 884. HTTP 500.0 - 명령행에서 실행한 ASP.NET Core 응용 프로그램을 실행하는 방법
13487정성태12/16/20232409개발 환경 구성: 696. C# - 리눅스용 AOT 빌드를 docker에서 수행 [1]
13486정성태12/15/20232221개발 환경 구성: 695. Nuget config 파일에 값 설정/삭제 방법
13485정성태12/15/20232100오류 유형: 883. dotnet build/restore - error : Root element is missing
13484정성태12/14/20232177개발 환경 구성: 694. Windows 디렉터리 경로를 WSL의 /mnt 포맷으로 구하는 방법
1  2  3  4  [5]  6  7  8  9  10  11  12  13  14  15  ...