-5

Could I get an explanation of what happens when a WPF application becomes idle and the user tries to use it again. For instance, when I click any UI control after the idle, it either takes quite some time longer than it should or the whole app just crashes. What is causing this issue and how can I solve it? (This is a single threaded application as well)

my779
  • 59
  • 6
  • can you post some code? or a debug log? – Cjen1 Aug 11 '15 at 16:14
  • its a MVVM WPF application calling a WCF service, theres nothing fancy in the code, just a single threaded application, what area of the code do you want to see? – my779 Aug 11 '15 at 16:15
  • The idle code, as in the application.idle event – Cjen1 Aug 11 '15 at 16:18
  • I dont have that in place, is that the issue? – my779 Aug 11 '15 at 16:22
  • maybe, are you using some form of debugging (visual studio, debug log etc)? – Cjen1 Aug 11 '15 at 16:24
  • no how does it work? sorry i'm new to this – my779 Aug 11 '15 at 16:32
  • ok first thing is to set breakpoints, just somewhere that will be hit on the press of a certain control. Then enter debug mode on visual studio (I'm assuming that is what you are using). Using the stepping through code, just go through the code until it crashes or hangs, or goes into an ifinite loop. That is where your error will be – Cjen1 Aug 11 '15 at 16:36
  • the application doesn't break normally, its just when its idle for quite some time. I have to replicate the idle? – my779 Aug 11 '15 at 16:48
  • yes unfortunately you would need to totally replicate the conditions under which the bug occured. – Cjen1 Aug 11 '15 at 16:55
  • http://stackoverflow.com/questions/5762526/how-can-i-make-something-that-catches-all-unhandled-exceptions-in-a-winforms-a works the same as in wpf. Come back once you've debugged it. –  Aug 11 '15 at 17:26

1 Answers1

0

We have faced same issue when WCF calls are there from UI. Basically WCF channels gets faulted if the application is idle for sometime.

Put try catch around WCF calling code and check if the app is crashing.

Once you confirm its WCF proxy issue look for proxy pooling, recreation of proxy via factory which takes care of fault state etc...

Joy George Kunjikkuru
  • 1,495
  • 13
  • 27