I have a WPF application with very complex XAMLs, I need a way to find out that my application freezes when I try to pause execution, the application does not seem to hang, the pointer will be on this line:
System.Windows.Application myApp; . . . . myApp.Run(); // <== this line
This happens when I change the layout of the taskbar or when Windows Explorer crashes (the taskbar is hidden), if I make these changes in strong repetition, the application will never recover, but when a small change occurs, the application will recover in a few minutes, I need to know the reason of this problem, I doubt the complex XAML files of my application, but I need a way to find out the page or component, or that the source of this freezes.
* EDIT *
I need a tool or a way to find out what XAML is, which consumes controller time!
* EDIT *
I have an exact reason for the freeze, this is due to creating an instance of ReportViewer in another thread. When I deleted the instantiation, it worked fine, it is strange that this error has existed in my application for a long time, but it has been hanging recently, I mean: my application will freeze when you paste one of these codes anywhere in my application:
new Action(() => { ReportViewer rv = new ReportViewer(); }).BeginInvoke(null, null);
OR
new Action(() => { ReportViewer rv = new ReportViewer(); rv.Dispose(); }).BeginInvoke(null, null);
OR
new Action(() => { ReportViewer rv = new ReportViewer(); rv.LocalReport.ReleaseSandboxAppDomain(); rv.Dispose(); }).BeginInvoke(null, null);
My questions:
1. What is the relationship between changing the window layout (resizing the taskbar or moving it) and a report viewer that is not added to any visual tree, why does this cause my application to freeze?
2- How to determine the location of the hang?
3. Several times the application is restored after a few minutes (3-5), but several times freezes in the clock and the application does not recover, why?
4 How can I identify the component or configuration that caused my application to freeze in these circumstances?
By the way, it is very useful for the rest if they are resolved. We spent a lot of time finding this, but we didn’t get the exact reason in combination with the ReportViewer causing the freeze!