Emulator & App lock up for no reason

njsokalski

Well-known member
Joined
Mar 16, 2011
Messages
102
Programming Experience
5-10
I am currently working on an app (using VB.NET & Silverlight). The app does several calculations, and they usually work fine. However, on occasion (maybe 1out of 10 times), the app locks up when I click one of the buttons. This happens regardless of whether I am running it using Deploy or Debug. Even when this happens when I am using Debug, it does not give me an error, is simply locks up. This happens when I simply click a Button which calls a method that just does a bunch of basic ifs, assignments, and other simple statements (no fancy graphics or communication with external sources or phone features). The other thing that is surprising is that the data that the method(s) are using is the same each time, yet it only locks up sometimes, but if it were a problem such as an infinite loop (which I checked my code for anyway), I would think it would lock up every time, but it doesn't. How can I figure out what the problem is? Thanks.
 

Herman

Well-known member
Joined
Oct 18, 2011
Messages
882
Location
Montreal, QC, CA
Programming Experience
10+
Add a 'My.Application.DoEvents()' somewhere in your deeper loop.... Or learn to use threading to do your calculations! Most likely one of the calculations is taking longer than usual and blocking your application from responding to OS messages.
 
Top Bottom