Click here to Skip to main content
15,885,771 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
My 32bit C# WPF application is crashing when I try to open a large data in my datagrids. There is no exception or error message. App just silently disappears.
How can I find the point (or reason) of crash.

I am using Visual Studio 2010 Pro.

Please help.

Thanks,

What I have tried:

I tried using Module window in debug mode but that too disappears as soon as app crashes.
Posted
Updated 19-Aug-16 0:15am
Comments
Richard MacCutchan 18-Aug-16 8:42am    
The only way to do this is by using the debugger and stepping through the code. You must know round about where the crash happens so you can set a breakpoint around there.
Smartguy3k 19-Aug-16 6:16am    
Hi Richard, thanks for helping. I tried to step through the code, line by line. I found sometimes the application is crashing even at the closing curly brackets of a function, just when the control is returning back from a function. I do not have any return statement in this function. I may have to keep trying, if I could find anything.
In case you have any more suggestions, please let me know.
Regards,
Matt T Heffron 18-Aug-16 13:55pm    
In addition to Richard's advice, I'd add that you probably should enable the debugger to automatically break on exceptions.
That's on the menu: Debug -> Exceptions...
In that dialog, check the "Thrown" column check box for "Common Language Runtime Exceptions"
This will probably give you some false positives (so maybe wait until you're at the last point in running your app before it crashes).
If this doesn't catch it, then you might need to check all of the check boxes!
Smartguy3k 19-Aug-16 6:24am    
Thanks Matt, I had no clue that there is such an option in Visual Studio. It didn't solve my issue, but definitely it will be helpful in future for debugging. I checked all the check boxes but the application disappeared (on crash) leaving no sign of error or exceptions, like I never executed. I would call it ninja crash.
Regards,

1 solution

You should learn to use the debugger as soon as possible. Rather than guessing what your code is doing, It is time to see your code executing and ensuring that it does what you expect.

The debugger allow you to follow the execution line by line, inspect variables and you will see that there is a point where it stop doing what you expect.
Debugger - Wikipedia, the free encyclopedia[^]
Mastering Debugging in Visual Studio 2010 - A Beginner's Guide[^]

The debugger is here to show you what your code is doing and your task is to compare with what it should do.
When the code don't do what is expected, you are close to a bug.
 
Share this answer
 
Comments
Srivastava Rajesh 17-Aug-21 2:17am    
HiI have a WPF desktop application and it's working fine through the code but once publish the application and installed on another machine then the login screen gets open and displayed the main page displayed for few second and then the application get closed automatically without giving any error.
Can anybody help me out to debug the issue?
Patrice T 17-Aug-21 2:23am    
Ask your own question for maximize visibility.
https://www.codeproject.com/Questions/ask.aspx[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900