Microsoft MVP성태의 닷넷 이야기
오류 유형: 67. ClickOnce 응용 프로그램이 실행되지 않을 때. [링크 복사], [링크+제목 복사],
조회: 29055
글쓴 사람
정성태 (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)
13485정성태12/15/20232100오류 유형: 883. dotnet build/restore - error : Root element is missing
13484정성태12/14/20232177개발 환경 구성: 694. Windows 디렉터리 경로를 WSL의 /mnt 포맷으로 구하는 방법
13483정성태12/14/20232319닷넷: 2184. C# - 하나의 resource 파일을 여러 프로그램에서 (AOT 시에도) 사용하는 방법파일 다운로드1
13482정성태12/13/20232920닷넷: 2183. C# - eFriend Expert OCX 예제를 .NET Core/5+ Console App에서 사용하는 방법 [2]파일 다운로드1
13481정성태12/13/20232293개발 환경 구성: 693. msbuild - .NET Core/5+ 프로젝트에서 resgen을 이용한 리소스 파일 생성 방법파일 다운로드1
13480정성태12/12/20232668개발 환경 구성: 692. Windows WSL 2 + Chrome 웹 브라우저 설치
13479정성태12/11/20232353개발 환경 구성: 691. WSL 2 (Ubuntu) + nginx 환경 설정
13477정성태12/8/20232549닷넷: 2182. C# - .NET 7부터 추가된 Int128, UInt128 [1]파일 다운로드1
13476정성태12/8/20232278닷넷: 2181. C# - .NET 8 JsonStringEnumConverter의 AOT를 위한 개선파일 다운로드1
13475정성태12/7/20232343닷넷: 2180. .NET 8 - 함수 포인터에 대한 Reflection 정보 조회파일 다운로드1
13474정성태12/6/20232185개발 환경 구성: 690. 닷넷 코어/5+ 버전의 ilasm/ildasm 실행 파일 구하는 방법 - 두 번째 이야기
13473정성태12/5/20232397닷넷: 2179. C# - 값 형식(Blittable)을 메모리 복사를 이용해 바이트 배열로 직렬화/역직렬화파일 다운로드1
13472정성태12/4/20232219C/C++: 164. Visual C++ - InterlockedCompareExchange128 사용 방법
13471정성태12/4/20232296Copilot - To enable GitHub Copilot, authorize this extension using GitHub's device flow
13470정성태12/2/20232602닷넷: 2178. C# - .NET 8부터 COM Interop에 대한 자동 소스 코드 생성 도입파일 다운로드1
13469정성태12/1/20232323닷넷: 2177. C# - (Interop DLL 없이) CoClass를 이용한 COM 개체 생성 방법파일 다운로드1
13468정성태12/1/20232258닷넷: 2176. C# - .NET Core/5+부터 달라진 RCW(Runtime Callable Wrapper) 대응 방식파일 다운로드1
13467정성태11/30/20232354오류 유형: 882. C# - Unhandled exception. System.Runtime.InteropServices.COMException (0x800080A5)파일 다운로드1
13466정성태11/29/20232524닷넷: 2175. C# - DllImport 메서드의 AOT 지원을 위한 LibraryImport 옵션
13465정성태11/28/20232294개발 환경 구성: 689. MSBuild - CopyToOutputDirectory가 "dotnet publish" 시에는 적용되지 않는 문제파일 다운로드1
13464정성태11/28/20232423닷넷: 2174. C# - .NET 7부터 UnmanagedCallersOnly 함수 export 기능을 AOT 빌드에 통합파일 다운로드1
13463정성태11/27/20232379오류 유형: 881. Visual Studio - NU1605: Warning As Error: Detected package downgrade
13462정성태11/27/20232394오류 유형: 880. Visual Studio - error CS0246: The type or namespace name '...' could not be found
13461정성태11/26/20232420닷넷: 2173. .NET Core 3/5+ 기반의 COM Server를 registry 등록 없이 사용하는 방법파일 다운로드1
13460정성태11/26/20232367닷넷: 2172. .NET 6+ 기반의 COM Server 내에 Type Library를 내장하는 방법파일 다운로드1
13459정성태11/26/20232337닷넷: 2171. .NET Core 3/5+ 기반의 COM Server를 기존의 regasm처럼 등록하는 방법파일 다운로드1
1  2  3  4  5  [6]  7  8  9  10  11  12  13  14  15  ...