Datetimepicker popup calls application to exit

This is the craziest thing I've ever seen.

I have a simple application that has nothing but a datetimepicker.

If I run the application inside VS (2013-2017) and open the calendar popup, everything works fine.

If I compile the application (debug or release) and run it, the application closes as soon as I click on the calendar icon.

There are no exceptions, attaching to a running process does not raise any exceptions, putting catch in an unhandled exception, everything will not catch anything in the UI or application thread.

The application targets .NET 4.5.1 with any processor. Same result if I target x86 or 64.

I think this is probably some kind of security policy or something, but it is not enough to know about it to ask the right question to the security team.

Here is the log from Debug Diagnostic Tool:
Boot control script C: \ Program Files \ DebugDiag \ scripts \ CrashRule_Process_WindowsFormsApp1.exe.vbs DumpPath is set to C: \ Program Files \ DebugDiag \ Logs \ Crash for all instances of WindowsFormsApp1.exe

[6/13/2017 11:40:42]
Process created. BaseModule - C: \ Users \ developer1 \ Documents \ Visual Studio 2017 \ Projects \ WindowsFormsApp1 \ bin \ Debug \ WindowsFormsApp1.exe. BaseThread System ID: 9468

C: \ Windows \ SysWOW64 \ ntdll.dll loaded from 0x774f0000
 A theme was created. New theme - System ID: 8472
 A theme has been created. New topic - System ID: 14748
 A topic has been created. New theme - System ID: 12908
 A theme has been created. New theme - System ID: 14436
 A theme has been created. New theme - System ID: 5704
 A theme has been created. New theme - System ID: 5880
 A theme has been created. New theme - System ID: 7596
 C: \ Windows \ SYSTEM32 \ MSCOREE.DLL loaded at 0x74ad0000
 C: \ Windows \ syswow64 \ KERNEL32.dll loaded at 0x769f0000
 C: \ Windows \ syswow64 \ KERNELBASE.dll loaded at 0x76e60000
 C: \ Windows \ syswow64 \ ADVAPI32.dll is loaded at 0x76fa0000
 C: \ Windows \ syswow64 \ msvcrt.dll is loaded at 0x753b0000
 C: \ Windows \ SysWOW64 \ sechost.dll loaded at 0x75460000
 C: \ Windows \ syswow64 \ RPCRT4.dll loaded at 0x750d0000
 C: \ Windows \ syswow64 \ SspiCli.dll loaded at 0x74d90000
 C: \ Windows \ syswow64 \ CRYPTBASE.dll loaded from 0x74d80000
 C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ mscoreei.dll loaded on 0x74a50000
 C: \ Windows \ syswow64 \ SHLWAPI.dll loaded from 0x751e0000
 C: \ Windows \ syswow64 \ GDI32.dll loaded on 0x77060000
 C : \ Windows \ syswow64 \ USER32.dll loaded from 0x752a0000
 C: \ Windows \ syswow64 \ LPK.dll loaded from 0x769e0000
 C: \ Windows \ syswow64 \ USP10.dll loaded from 0x766e0000
 C: \ Windows \ system32 \ IMM32.DLL loaded from 0x75240000
 C: \ Windows \ syswow64 \ MSCTF.dll loaded from 0x76ec0000
 C: \ Windows \ system32 \ ctiuser.dll loaded from 0x749d0000
 C: \ Windows \ syswow64 \ WS2_32.dll loaded from 0x75050000
 C: \ Windows \ syswow64 \ NSI.dll loaded from 0x75480000
 C: \ Windows \ syswow64 \ PSAPI.DLL loaded at 0x774c0000
 C: \ Windows \ system32 \ FLTLIB.DLL loaded at 0x749c0000
 C: \ Windows \ system32 \ VERSION.dll loaded from 0x749b0000
 C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ clr.dll loaded at 0x742f0000
 C: \ Windows \ system32 \ MSVCR120_CLR0400.dll loaded at 0x741f0000
 C: \ Windows \ assembly \ NativeImages_v4.0.30319_32 \ mscorlib \ 50bcbedc6ed7027bd709339d3escor0000.dll loaded at 0x741f0000
 C: \ Windows \ syswow64 \ ole32.dll loaded from 0x76560000
 C: \ Windows \ system32 \ uxtheme.dll loaded from 0x6cdd0000
 C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ clrjit.dll loaded from 0x73020000
 C: \ Windows \ syswow64 \ OLEAUT32.dll loaded from 0x76dc0000
 C: \ Windows \ assembly \ NativeImages_v4.0.30319_32 \ System \ 48fb602d35146bc0c0002b21343a9f56 \ System.ni.dll loaded at 0x72690000
 C: \ Windows \ assembly \ Native.319_v4.0 d59cbbb217b18f4219761e344ccf1c10 \ System.Drawing.ni.dll loaded from 0x6a610000
 C: \ Windows \ assembly \ NativeImages_v4.0.30319_32 \ System.Windows.Forms \ a615de88390374e7e71749451bfa5eFaf \ System.Windows.Corms loaded from 0x6a610000.dll
 C: \ Windows \ WinSxS \ x86_microsoft.windows.common -controls_6595b64144ccf1df_5.82.7601.18837_none_ec86b8d6858ec0bc \ comctl32.dll loaded with 0x71c90000
 the C: \ the Windows \ the WinSxS \ x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.18837_none_41e855142bd5705d \ comctl32.dll loaded with 0x6cc30000
 C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ nlssorting.dll loaded with 0x72270000
 the C: \ the Windows \ assembly \ NativeImages_v4.0.30319_32 \ System.Core \ a514635984ff3f4239dc0421b7e024b9 \ System.Core.ni.dll loaded with 0x68370000
 the C : \ Windows \ assembly \ NativeImages_v4.0.30319_32 \ System.Configuration \ a11c194343da7333f7f7e38960758384 \ System.Configuration.ni.dll loaded from 0x6ab30000
 C: \ Windows \ assembly \ NativeImages_v4.0.30319_32 \ System.Xml \ 43529c5402fb2a8ebc8c76877b802cdc \ System.Xml.ni.dll loaded from 0x68f70000
 C: \ Windows \ syswow64 \ shell32.dll loaded from 0x75490000

C: \ Windows \ WinSxS \ x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.7601.23721_none_5c052bcda00f9399 \ gdiplus.dll loaded on 0x6b010000
 the C: \ the Windows \ system32 folder \ dwmapi.dll loaded with 0x6ecc0000
 created topic. New topic - System ID: 6124
 Initializing control script
 Clearing any existing breakpoints

 Current list of breakpoints (BL)
 [6/13/2017 11:40:43 AM]
 Locked. Exit Stream - System ID: 6124. Exit Code - 0x00000000
 [6/13/2017 11:41:11 AM]
 Thread created. New theme - System ID: 14984
 C: \ Windows \ SysWOW64 \ CRYPTSP.dll loaded from 0x74c20000
 C: \ Windows \ SysWOW64 \ rsaenh.dll loaded at 0x74be0000
 C: \ Windows \ SysWOW64 \ RpcRtRemote.dll loaded from 0x74bd0000
 A theme was created. New topic - System ID: 13868 Locked
 topic. Exiting the stream - System ID: 12908. Exit code - 0x00000001
 Locked topic. Exit stream - System ID: 13868. Exit code - 0x00000001
 Locked topic. Exit stream - System ID: 14984. Exit code - 0x00000001
 Locked topic. Exit stream - System ID: 7596. Exit code - 0x00000001
 Locked topic. Exit stream - System ID: 5704. Exit code - 0x00000001
 Locked topic. Exiting the stream - System ID: 5880. Exit code - 0x00000001
 Locked topic. Exit stream - System ID: 14436. Exit code - 0x00000001
 The topic is closed. Exit stream - System ID: 14748. Exit code - 0x00000001
 Locked topic. Exit thread - System ID: 8472. Exit code - 0x00000001
 Process exited. Exit code - 0x00000001

 Debug overhead:
 Total expired ticks = 28767 (100%)
 Total number of pending ticks in the Engine debugger = 920 (3%)
 Total number of chips in the crash rule script = 63 (0%)

+3


source to share


2 answers


Okay, I had a very similar experience. This issue has only been experienced by some customers. This was caused by their antivirus program (CarbonBlack in my case).

In the event log I found this entry under "CbDefense" EventId: 17

'Info: Application "MYEXEPATH" tried to inject code into process "MYEXEPATH" by calling function "SetWindowsHookExW". The operation was blocked and the application ended Confer. '



If they clicked on the WinForm DateTimePicker, it will crash the program.

(targeting C # .NET 3.5 was created)

0


source


Do you have a breakpoint for any of your DateTimePicker events? If so, remove the breakpoint (s) and the problem should stop. This is a known issue for Microsoft Windows Forms Team on this page: https://connect.microsoft.com/VisualStudio/feedback/details/1290685/debugging-datetimepicker-event-hangs-vs :



"The DateTimePicker control sets the mouse hook as part of its functionality, but when the debugger has the WinForms application stopped at a breakpoint, it allows a deadlock if the VS Server receives a mouse message. Deadlock is unfortunately a consequence of the DateTimePicker design. The mouse hook is set when clicking on the dropdown to display the calendar. This means that breakpoints should not be dispatched in event handlers that will be triggered while the calendar is active. We are currently investigating if this can be resolved and we will update this thread with additional information if we can make the fix available. "

-1


source







All Articles