1

I received an error report regarding a WPF app that wouldn't start up in a Windows Server 2008 Service pack 2 server (the application is an administration tool we're distributing to our customers). Since this application has a lot of external references, I tried to simplify the problem by creating a simple WPF application using Visual Studio 2013: a plain white window with "hello world" showing and nothing more. I tried to make it run in the production server, with no luck: it always crashes immediately.

Here's what I have:

  • the application was created with the standard VS 2013 template for WPF, so it had 3.5 as the target framework; i changed it to 4.6
  • the server has the 3.5 SP1 and 4.6 versions of the .net framework installed
  • the app.config is well-formed, with the configSections section on top, no additional references besides log4net, supportedRuntime tag set according to the target framework version
  • I already checked that there are no project references from version 3.5 left in the project
  • I already tried logging in the DispatcherUnhandledException and in the AppDomain.UnhandledException handlers
  • the application runs in my development environment
  • the application runs in production environment only if I change the target framework to 3.5. In this case, the WPF windows shows up and the log file is correctly produced
  • I already tried producing a dump and trying to debug it in Visual Studio: I just get a "Source not available" message and a stack trace ending with ntdll.dll!NtWaitForSingleObject()

Here are the error details:

Description:

Stopped working

Problem signature:

Problem Event Name: APPCRASH

Application Name: MyApp.exe

Application Version: 1.0.0.0

Application Timestamp: 5bfc07f1

Fault Module Name: KERNEL32.dll

Fault Module Version: 6.0.6002.24367

Fault Module Timestamp: 5ae3dcd9

Exception Code: e0434352

Exception Offset: 000000000001667d

OS Version: 6.0.6002.2.2.0.272.7

Locale ID: 1033


The Windows event log shows little information:

Faulting application MyApp.exe, version 1.0.0.0, time stamp 0x5bfc07f1, faulting module KERNEL32.dll, version 6.0.6002.24367, time stamp 0x5ae3dcd9, exception code 0xe0434352, fault offset 0x000000000001667d, process id 0x%9, application start time 0x%10.

Application: MyApp.exe

Framework Version: v4.0.30319

Description: The process was terminated due to an unhandled exception.

Exception Info: exception code e0434352, exception address 0000000077A6667D

Stack: [this is empty]


Any suggestions?

Sue Maurizio
  • 662
  • 7
  • 17
  • Does it work without `log4net `? – Rekshino Nov 26 '18 at 15:58
  • With as little information as you have, I suspect that the only people who might help you work for Microsoft. Consider opening a support case (particularly if you have Premier Support) – Flydog57 Nov 26 '18 at 15:59
  • 1
    0xe0434352 is a .NET exception. Load the crash dump in WinDbg, load the SOS extension and use `!pe` it should give you the exception and a call stack. Or load the crash dump in Visual Studio and choose managed debugging. – Thomas Weller Nov 26 '18 at 16:03
  • @Rekshino it crashes with or without log4net – Sue Maurizio Nov 26 '18 at 16:06
  • @ThomasWeller I already tried debugging the crash dump with VS; I gave up when I found myself trying to understand assembly lines – Sue Maurizio Nov 26 '18 at 16:08
  • If you have a crash dump and can upload it somewhere, I might have a look into it. Email to thomasweller???wellisolutions.de – Thomas Weller Nov 26 '18 at 16:11
  • Sure, that server has .NET 4.6 installed(no windows updates after installation)? – Rekshino Nov 26 '18 at 16:12
  • 1
    It's likely a missing dependency. Perhaps something installed on Windows that's missing on Windows Server. You could use Dependency Walker to make sure it can find all the required DLLs. There is also a similar post on SO https://stackoverflow.com/questions/6244939/how-do-i-fix-a-net-windows-application-crashing-at-startup-with-exception-code – bwing Nov 26 '18 at 16:14
  • @Rekshino no recent windows updates AFAIK, .net 4.6 was installed a few days ago – Sue Maurizio Nov 26 '18 at 16:14
  • @bwing I already tried with Dependency Walker, the only entries missing are also missing in my development environment – Sue Maurizio Nov 26 '18 at 16:16
  • @ThomasWeller I'm afraid I can't for security reasons: it's from a customer's server – Sue Maurizio Nov 26 '18 at 16:18
  • I've already troubleshooted this kind of issue with ***Process Monitor*** (a.k.a. ***ProcMon***): filter by process name to only target your application, then run the application until it crashes, then stop capturing events, and finally analyze the logs by restricting on non successful result. I bet on a missing native **C/C++ runtime library**. – Pragmateek Nov 26 '18 at 16:27
  • Have you checked that .net 4.6 is installed (see https://learn.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed) – auburg Nov 26 '18 at 16:29
  • @Pragmateek I also tried with ProcessMonitor; I was looking for something like a "file not found" entry but found none. That tool offers a lot of information but I don't know what type of entries should I concentrate on. Any suggestions? – Sue Maurizio Nov 26 '18 at 16:33
  • You can filter on **file-system** activity only by unchecking the other activities at the far right of the toolbar. – Pragmateek Nov 26 '18 at 16:48
  • Missing libraries are just a guess. Please, do a `.loadby sos mscorwks; .loadby sos clr; !pe; !pe` and post the results here. The only evidence there is in the moment is the exception code of a .NET exception. – Thomas Weller Nov 26 '18 at 17:12
  • It keeled over before it got to Main(). That's not terribly unusual, jitting the Main() method can cause plenty of trouble. You're blind without seeing the managed exception details, the DebugDiag utility can make you see. – Hans Passant Nov 28 '18 at 08:41

1 Answers1

0

Just in case someone else stumbles on the same problem, looks like the KB4457921 update from Microsoft somehow solves the issue. If an update is not possible, consider porting the code back to .net framework v. 3.5.

Sue Maurizio
  • 662
  • 7
  • 17