Search code examples
.netwpfentity-frameworkwindows-installersetup-deployment

Find Class, Method, and Line Location of WPF Setup/Deployment Error


I'm trying to deploy my first WPF application using the method found here. The .exe and .msi files can be loaded onto another machine, and the program runs fine on the host machine, but the application can't run due to an error. Using the explanation on another question, the WER trace indicates a File Not Found Exception:

<ProblemSignatures>
    <EventType>CLR20r3</EventType>
    <Parameter0>TestProgram.exe</Parameter0>
    <Parameter1>1.0.0.0</Parameter1>
    <Parameter2>57421ac1</Parameter2>
    <Parameter3>TestProgram</Parameter3>
    <Parameter4>1.0.0.0</Parameter4>
    <Parameter5>57421ac1</Parameter5>
    <Parameter6>8</Parameter6>
    <Parameter7>1b</Parameter7>
    <Parameter8>System.IO.FileNotFoundException</Parameter8>
</ProblemSignatures>

First, because the solution's non-setup project wasn't set as the Startup object, I tried setting that project as Startup object, rebuilding the solution and its projects, and redeploying.

After the error remained, I next looked at the Detected Dependencies of the setup project and noticed Microsoft .NET Framework, EntityFramework.dll, EntityFramework.SqlServer.dll, and System.Net.Http.dll. I thought about deleting the EF and Http dll files because the error may be looking for Visual Studio, which is not available on the target machine.

Is that interpretation correct or is there another problem that anyone can spot? The program isn't using any third-party software outside of those included in Visual Studio. Many thanks in advance!

EDIT 1:

I downloaded WinDBG and opened the executable on the target machine. Before running the "Go", the following appeared:

Executable search path is: 
ModLoad: 00000000`00eb0000 00000000`00f10000   TestProgram.exe
ModLoad: 00000000`776a0000 00000000`7784a000   ntdll.dll
ModLoad: 00000000`77880000 00000000`77a00000   ntdll32.dll
ModLoad: 00000000`73dc0000 00000000`73dff000   C:\Windows\SYSTEM32\wow64.dll
ModLoad: 00000000`73d60000 00000000`73dbc000   C:\Windows\SYSTEM32\wow64win.dll
ModLoad: 00000000`73d50000 00000000`73d58000   C:\Windows\SYSTEM32\wow64cpu.dll
(151c.15f0): Break instruction exception - code 80000003 (first chance)
ntdll!LdrpDoDebuggerBreak+0x30:
00000000`77747800 cc              int     3

As this occurred before the program ran, does this indicate a missing assembly "wow64cpu.dll" on the target machine? After pressing "Debug => Go", this is displayed:

0:000> g
ModLoad: 00000000`77580000 00000000`7769f000   WOW64_IMAGE_SECTION
ModLoad: 00000000`771e0000 00000000`772f0000   WOW64_IMAGE_SECTION
ModLoad: 00000000`77580000 00000000`7769f000   NOT_AN_IMAGE
ModLoad: 00000000`77480000 00000000`7757a000   NOT_AN_IMAGE
ModLoad: 00000000`73d00000 00000000`73d4a000   C:\Windows\SysWOW64\MSCOREE.DLL
ModLoad: 00000000`771e0000 00000000`772f0000   C:\Windows\syswow64\KERNEL32.dll
ModLoad: 00000000`76af0000 00000000`76b37000   C:\Windows\syswow64\KERNELBASE.dll
(151c.15f0): WOW64 breakpoint - code 4000001f (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
ntdll32!LdrpDoDebuggerBreak+0x2c:
77920e14 cc              int     3

Does this indicate KERNELBASE.dll as the problem code? Pressing "Go" after this error, the application loads and behaves correctly. Does anyone see a cure to this?

EDIT 2:

I've done quite a bit of research to learn about WinDBG and find offending code, but I still can't get to the exact source. Here's the crash dump after attaching WinDBG to the process, but I can't seem to find any comprehensive lists of DEFAULT_BUCKET_ID meanings or the like anywhere on the web:

Loading Dump File [C:\mydump.dmp]
User Mini Dump File with Full Memory: Only application data is available

************* Symbol Path validation summary **************
Response                         Time (ms)     Location
Deferred                                       srv*
Symbol search path is: srv*
Executable search path is: 
Windows 7 Version 7601 (Service Pack 1) MP (2 procs) Free x64
Product: WinNt, suite: SingleUserTS
Built by: 6.1.7601.18015 (win7sp1_gdr.121129-1432)
Machine Name:
Debug session time: Tue May 24 09:16:17.000 2016 (UTC - 5:00)
System Uptime: 0 days 21:10:24.768
Process Uptime: 0 days 0:18:49.000
..............................................
This dump file has a breakpoint exception stored in it.
The stored exception information can be accessed via .ecxr.
ntdll!DbgBreakPoint:
00000000`776eae10 cc              int     3


0:004> !analyze -v
*******************************************************************************
*                                                                                 *
*                        Exception Analysis                                       *
*                                                                                 *
*******************************************************************************

*** WARNING: Unable to verify checksum for mscorlib.ni.dll
*** WARNING: Unable to verify checksum for TestProject.exe
*** ERROR: Module load completed but symbols could not be loaded for TestProject.exe

DUMP_CLASS: 2

DUMP_QUALIFIER: 400

CONTEXT:  (.ecxr)
rax=00000000fffaa000 rbx=0000000000000000 rcx=00000000fffdf000
rdx=0000000000000000 rsi=0000000000000000 rdi=0000000000000000
rip=00000000776eae10 rsp=00000000005ffb08 rbp=0000000000000000
 r8=0000000000000000  r9=0000000077792c50 r10=0000000000000000
r11=0000000000000000 r12=0000000000000000 r13=0000000000000000
r14=0000000000000000 r15=0000000000000000
iopl=0         nv up ei pl zr na po nc
cs=0033  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00000244
ntdll!DbgBreakPoint:
00000000`776eae10 cc              int     3
Resetting default scope

FAULTING_IP: 
ntdll!DbgBreakPoint+0
00000000`776eae10 cc              int     3

EXCEPTION_RECORD:  (.exr -1)
ExceptionAddress: 00000000776eae10 (ntdll!DbgBreakPoint)
    ExceptionCode: 80000003 (Break instruction exception)
   ExceptionFlags: 00000000
NumberParameters: 1
   Parameter[0]: 0000000000000000

DEFAULT_BUCKET_ID:  STATUS_BREAKPOINT_NOSOS

PROCESS_NAME:  TestProject.exe

ERROR_CODE: (NTSTATUS) 0x80000003 - {EXCEPTION}  Breakpoint  A breakpoint has been reached.

EXCEPTION_CODE: (HRESULT) 0x80000003 (2147483651) - One or more arguments are invalid

EXCEPTION_CODE_STR:  80000003

EXCEPTION_PARAMETER1:  0000000000000000

WATSON_BKT_PROCSTAMP:  4b90752b

WATSON_BKT_PROCVER:  4.0.40305.0

PROCESS_VER_PRODUCT:  Microsoft® .NET Framework

WATSON_BKT_MODULE:  ntdll.dll

WATSON_BKT_MODSTAMP:  5708a857

WATSON_BKT_MODOFFSET:  4ae10

WATSON_BKT_MODVER:  6.1.7601.23418

MODULE_VER_PRODUCT:  Microsoft® Windows® Operating System

BUILD_VERSION_STRING:  6.1.7601.23418 (win7sp1_ldr.160408-2045)

MODLIST_WITH_TSCHKSUM_HASH:  94102de765f4eea4636b2c54fba83facd31885fb

MODLIST_SHA1_HASH:  909c35bf4b61b0a9036f6eafbb05dcb2b73eca6c

NTGLOBALFLAG:  0

APPLICATION_VERIFIER_FLAGS:  0

PRODUCT_TYPE:  1

SUITE_MASK:  272

DUMP_FLAGS:  c07

DUMP_TYPE:  0

APP:  testproject.exe

MISSING_CLR_SYMBOL: 0

ANALYSIS_SESSION_HOST:  JLE-PC

ANALYSIS_SESSION_TIME:  05-24-2016 09:47:17.0337

ANALYSIS_VERSION: 10.0.10586.567 amd64fre

MANAGED_CODE: 1

MANAGED_ENGINE_MODULE:  clr

THREAD_ATTRIBUTES: 
  OS_LOCALE:  ENU

PROBLEM_CLASSES: 

    Tid    [0x0]
    Frame  [0x00]
    String [STATUS_BREAKPOINT]
    Data Bucketing

NOSOS
    Tid    [0xdc0]
    Failure Bucketing

BUGCHECK_STR:  STATUS_BREAKPOINT_NOSOS

PRIMARY_PROBLEM_CLASS:  MANUAL_BREAKIN

STACK_TEXT:  
00000000`005ffb08 00000000`77792c88 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : ntdll!DbgBreakPoint
00000000`005ffb10 00000000`777023fc : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : ntdll!DbgUiRemoteBreakin+0x38
00000000`005ffb40 00000000`00000000 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : ntdll!RtlUserThreadStart+0x25

THREAD_SHA1_HASH_MOD_FUNC:  7022ac660180cc117dbba4701e87bc997be1e021

THREAD_SHA1_HASH_MOD_FUNC_OFFSET:  2758687e8d5375c704a76728e5a036d2024bc4a9

THREAD_SHA1_HASH_MOD:  ec3b5fdb1c6f649ec34d8fd34d70509a58a63226

FOLLOWUP_IP: 
    ntdll!DbgBreakPoint+0
00000000`776eae10 cc              int     3

FAULT_INSTR_CODE:  ccccc3cc

SYMBOL_STACK_INDEX:  0

SYMBOL_NAME:  ntdll!DbgBreakPoint+0

FOLLOWUP_NAME:  MachineOwner

MODULE_NAME: ntdll

IMAGE_NAME:  ntdll.dll

DEBUG_FLR_IMAGE_TIMESTAMP:  5708a857

STACK_COMMAND:  .ecxr ; kb

BUCKET_ID:  MANUAL_BREAKIN

BUCKET_ID_OFFSET:  0

BUCKET_ID_MODULE_STR:  ntdll

BUCKET_ID_MODTIMEDATESTAMP:  5708a73e

BUCKET_ID_MODCHECKSUM:  1422cd

BUCKET_ID_MODVER_STR:  6.1.7601.23418

BUCKET_ID_PREFIX_STR:  MANUAL_BREAKIN

FAILURE_PROBLEM_CLASS:  STATUS_BREAKPOINT_NOSOS

FAILURE_EXCEPTION_CODE:  80000003

FAILURE_IMAGE_NAME:  ntdll.dll

FAILURE_FUNCTION_NAME:  DbgBreakPoint

BUCKET_ID_FUNCTION_STR:  DbgBreakPoint

FAILURE_SYMBOL_NAME:  ntdll.dll!DbgBreakPoint

FAILURE_BUCKET_ID:  STATUS_BREAKPOINT_NOSOS_80000003_ntdll.dll!DbgBreakPoint

WATSON_STAGEONE_URL:  http://watson.microsoft.com/StageOne/TestProject.exe/4.0.40305.0/4b90752b/ntdll.dll/6.1.7601.23418/5708a857/80000003/0004ae10.htm?Retriage=1

TARGET_TIME:  2016-05-24T14:16:17.000Z

OSBUILD:  7601

OSSERVICEPACK:  23418

SERVICEPACK_NUMBER: 0

OS_REVISION: 0

OSPLATFORM_TYPE:  x64

OSNAME:  Windows 7

OSEDITION:  Windows 7 WinNt (Service Pack 1) SingleUserTS

USER_LCID:  0

OSBUILD_TIMESTAMP:  2016-04-09 01:57:39

BUILDDATESTAMP_STR:  160408-2045

BUILDLAB_STR:  win7sp1_ldr

BUILDOSVER_STR:  6.1.7601.23418

ANALYSIS_SESSION_ELAPSED_TIME: 857e

ANALYSIS_SOURCE:  UM

FAILURE_ID_HASH_STRING:  um:status_breakpoint_nosos_80000003_ntdll.dll!dbgbreakpoint

FAILURE_ID_HASH:  {be84a3d9-49dc-a8ad-4a71-89a1a8bdbc50}

Followup:     MachineOwner
---------

Here's the thread list:

0:004> ~
   0  Id: dd8.150c Suspend: 1 Teb: 00000000`fffdb000 Unfrozen
   1  Id: dd8.125c Suspend: 1 Teb: 00000000`fffd8000 Unfrozen
   2  Id: dd8.17c4 Suspend: 1 Teb: 00000000`fffd5000 Unfrozen
   3  Id: dd8.15c0 Suspend: 1 Teb: 00000000`fffad000 Unfrozen
   4  Id: dd8.dc0 Suspend: 0 Teb: 00000000`fffaa000 Unfrozen

And here's the call stack of these threads, but I still don't know where to go from here:

0:004> ~*kn

   0  Id: dd8.150c Suspend: 1 Teb: 00000000`fffdb000 Unfrozen
 # Child-SP          RetAddr           Call Site
00 00000000`0019e908 00000000`73d5283e wow64cpu!CpupSyscallStub+0x9
01 00000000`0019e910 00000000`73dcd286 wow64cpu!WaitForMultipleObjects32+0x3b
02 00000000`0019e9d0 00000000`73dcc69e wow64!RunCpuSimulation+0xa
03 00000000`0019ea20 00000000`776df9b6 wow64!Wow64LdrpInitialize+0x42a
04 00000000`0019ef70 00000000`7773bb89 ntdll!LdrpInitializeProcess+0x17e3
05 00000000`0019f460 00000000`776ca0ee ntdll! ?? ::FNODOBFM::`string'+0x22a30
06 00000000`0019f4d0 00000000`00000000 ntdll!LdrInitializeThunk+0xe

   1  Id: dd8.125c Suspend: 1 Teb: 00000000`fffd8000 Unfrozen
 # Child-SP          RetAddr           Call Site
00 00000000`01f3edd8 00000000`73d5283e wow64cpu!CpupSyscallStub+0x9
01 00000000`01f3ede0 00000000`73dcd286 wow64cpu!WaitForMultipleObjects32+0x3b
02 00000000`01f3eea0 00000000`73dcc69e wow64!RunCpuSimulation+0xa
03 00000000`01f3eef0 00000000`777098dc wow64!Wow64LdrpInitialize+0x42a
04 00000000`01f3f440 00000000`776ca0ee ntdll! ?? ::FNODOBFM::`string'+0x22b74
05 00000000`01f3f4b0 00000000`00000000 ntdll!LdrInitializeThunk+0xe

   2  Id: dd8.17c4 Suspend: 1 Teb: 00000000`fffd5000 Unfrozen
 # Child-SP          RetAddr           Call Site
00 00000000`01fef038 00000000`73d52bf1 wow64cpu!CpupSyscallStub+0x9
01 00000000`01fef040 00000000`73dcd286 wow64cpu!Thunk0ArgReloadState+0x23
02 00000000`01fef100 00000000`73dcc69e wow64!RunCpuSimulation+0xa
03 00000000`01fef150 00000000`777098dc wow64!Wow64LdrpInitialize+0x42a
04 00000000`01fef6a0 00000000`776ca0ee ntdll! ??  ::FNODOBFM::`string'+0x22b74
05 00000000`01fef710 00000000`00000000 ntdll!LdrInitializeThunk+0xe

   3  Id: dd8.15c0 Suspend: 1 Teb: 00000000`fffad000 Unfrozen
 # Child-SP          RetAddr           Call Site
00 00000000`020de908 00000000`73d5283e wow64cpu!CpupSyscallStub+0x9
01 00000000`020de910 00000000`73dcd286 wow64cpu!WaitForMultipleObjects32+0x3b
02 00000000`020de9d0 00000000`73dcc69e wow64!RunCpuSimulation+0xa
03 00000000`020dea20 00000000`777098dc wow64!Wow64LdrpInitialize+0x42a
04 00000000`020def70 00000000`776ca0ee ntdll! ?? ::FNODOBFM::`string'+0x22b74
05 00000000`020defe0 00000000`00000000 ntdll!LdrInitializeThunk+0xe

#  4  Id: dd8.dc0 Suspend: 0 Teb: 00000000`fffaa000 Unfrozen
 # Child-SP          RetAddr           Call Site
00 00000000`005ffb08 00000000`77792c88 ntdll!DbgBreakPoint
01 00000000`005ffb10 00000000`777023fc ntdll!DbgUiRemoteBreakin+0x38
02 00000000`005ffb40 00000000`00000000 ntdll!RtlUserThreadStart+0x25

Any help here would be greatly appreciated. I've spent quite a bit of time researching and am still looking for anything that will say "The error is in class [class name] in method [method name] on line x." When I try to follow the walkthrough here, WinDBG returns "No [command name] found."


Solution

  • Your dump trace info doesn't look quite right because you broke into it, so the stack traces mostly indicate a break exception (but I'm no WinDBG expert).

    It would help to know when the app crashes. If it's immediate then it could be a missing dependency, and the Fusion Log Viewer might help with that. It's also not clear if your code is completely managed or has any C++ in it, which would require C++ runtime support on the target system.

    Also, what version of Visual Studio did you use to build this, and are you sure your required .NET FW is installed on the target system?