WPF UI crashes only when debugging

5

If I go to Debug -> Start Without Debugging my WPF app runs fine, but if I go to Debug -> Start Debugging then the UI will disappear and this will be in the Output window under Debug:

The program '[6744] UI.exe: Managed (v4.0.30319)' has exited with code -1073740791 (0xc0000409)

No exceptions are thrown or anything. Why might this happen? I am using the Prism library so I'm not sure if it is related to that.

I am able to debug without crashes if I attach the debugger to the process manually.

c#
.net
wpf
xaml
prism
asked on Stack Overflow Apr 26, 2011 by user404068 • edited Apr 26, 2011 by user404068

6 Answers

1

In my case, I have the same problem. When I changed the "Assembly name" to, in the max 42 characters, my app was build...

I thought that is crazy, but work.

answered on Stack Overflow Jan 19, 2012 by anmaia
0

You probably have a heap corrupting exception during object initializations (stackoverflow or an arbitrary out-of-memory condition). This is mostly caused by P/Invoke methods or other unsafe code. If you're not using any unsafe code, check out the 3rd party libraries that you're using as the source of error.

answered on Stack Overflow Apr 26, 2011 by Teoman Soygul
0

If You are using PRISM some errors can occur if any of Containers (set as region) has content. Every regions must be empty container controls or empty item controls.

Prism has a few different configuration for Debug and Release mode that can be a reason. Try to analyze line by line Your XAML code files where You have regions controls and check if tags are empty. The best way to be sure that containers are empty is to create short tag versions

e.g. try this

<ContentControl />

instead of this

<ContentControl></ContentControl>
answered on Stack Overflow Feb 7, 2012 by BrightShadow
0

I have a similar problem in my multi threading app. I was trying to find the solution but no success. If your app using sime kind of multi threading - the issue may be in it. Check, that you UI run in same thread with the main thread...

answered on Stack Overflow Mar 17, 2012 by badmadbot
0

This problem could be caused by Microsoft EMET (Enhanced Mitigation Experience Toolkit) utility (http://support.microsoft.com/kb/2458544) if you have such installed.

Check the Application Event Log for errors like "Application Name: UI.exe. EMET detected EAF mitigation and will close the application: UI.exe".

If you have such errors - try to configure or just uninstall EMET :-)

answered on Stack Overflow Jul 10, 2013 by Vlad Rudenko
0

I had the same problem, have changed "Platform target" from x86 to "Any CPU" and it works fine. But only for VS2010, not for VS2013

answered on Stack Overflow Feb 7, 2014 by Oleg Sh

User contributions licensed under CC BY-SA 3.0