|
ms
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
debug problem (UI) ...Hi all
I have a little problem with debugging ... I have build a application (MDI Container) with plugins, and now, for some reason, after about 1h the applications hangs, without error message ... I have tried to debug in visual studio (attach process) and I have seen the application is still running, it seams just the GUI is blocked ... But also when debugging, there is no exception rised ... ??? How can I find out what is happening ?? Any ideas? Thanks for any comments Frank Uray What do the plug-ins do? Are they COM objects? Maybe they are the cause.
Does your app have issues if the plug-in section of the code is commented out? Show quoteHide quote "Frank Uray" <FrankU***@discussions.microsoft.com> wrote in message news:5A407FF4-F6B8-426C-A176-4D58B958FDA2@microsoft.com... > Hi all > > I have a little problem with debugging ... > I have build a application (MDI Container) with plugins, > and now, for some reason, after about 1h the applications > hangs, without error message ... > > I have tried to debug in visual studio (attach process) > and I have seen the application is still running, > it seams just the GUI is blocked ... > But also when debugging, there is no exception rised ... ??? > > How can I find out what is happening ?? > Any ideas? > > Thanks for any comments > > Frank Uray Hi
No, the PlugIns do not use COM, but some of them are using Form.Invoke . I am guessing there is a problem in one of the PlugIns, but the question is, how can I find such errors ??? Best regards Frank Uray Show quoteHide quote "jp2msft" wrote: > What do the plug-ins do? Are they COM objects? Maybe they are the cause. > Does your app have issues if the plug-in section of the code is commented > out? > > "Frank Uray" <FrankU***@discussions.microsoft.com> wrote in message > news:5A407FF4-F6B8-426C-A176-4D58B958FDA2@microsoft.com... > > Hi all > > > > I have a little problem with debugging ... > > I have build a application (MDI Container) with plugins, > > and now, for some reason, after about 1h the applications > > hangs, without error message ... > > > > I have tried to debug in visual studio (attach process) > > and I have seen the application is still running, > > it seams just the GUI is blocked ... > > But also when debugging, there is no exception rised ... ??? > > > > How can I find out what is happening ?? > > Any ideas? > > > > Thanks for any comments > > > > Frank Uray > > > My best advice would be to start dropping try...catch routines all through
your code: try { // code } catch (Exception err) { MessageBox.Show(err.ToString(), "Error at Line X"); // fill in the X } The ToString() method should tell you the line number (if you are in debug mode) where the error occurred. Start by making your try...catch routines encompass large sections of your code, then narrow them down to smaller and smaller sections as you get your bugs eliminated. Personally, I even keep a try...catch block covering my main function: [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); try { Application.Run(new Form1()); } catch (Exception err) { MessageBox.Show(err.ToString(), "Main() Error"); } } Show quoteHide quote "Frank Uray" wrote: > Hi > > No, the PlugIns do not use COM, > but some of them are using Form.Invoke . > > I am guessing there is a problem in one of the PlugIns, > but the question is, how can I find such errors ??? > > Best regards > Frank Uray > > "jp2msft" wrote: > > > What do the plug-ins do? Are they COM objects? Maybe they are the cause. > > Does your app have issues if the plug-in section of the code is commented > > out? > > > > "Frank Uray" <FrankU***@discussions.microsoft.com> wrote in message > > news:5A407FF4-F6B8-426C-A176-4D58B958FDA2@microsoft.com... > > > Hi all > > > > > > I have a little problem with debugging ... > > > I have build a application (MDI Container) with plugins, > > > and now, for some reason, after about 1h the applications > > > hangs, without error message ... > > > > > > I have tried to debug in visual studio (attach process) > > > and I have seen the application is still running, > > > it seams just the GUI is blocked ... > > > But also when debugging, there is no exception rised ... ??? > > > > > > How can I find out what is happening ?? > > > Any ideas? > > > > > > Thanks for any comments > > > > > > Frank Uray > > > > > > Hello
Thanks again for your answer. I have tried this try-catch within the main, but it does not help, still the same problem ... :-(( The GUI is blocked, but I am able to debug (attach to process) the application ... ?? Best regards Frank Uray Show quoteHide quote "jp2msft" wrote: > My best advice would be to start dropping try...catch routines all through > your code: > > try { > // code > } catch (Exception err) { > MessageBox.Show(err.ToString(), "Error at Line X"); // fill in the X > } > > The ToString() method should tell you the line number (if you are in debug > mode) where the error occurred. > > Start by making your try...catch routines encompass large sections of your > code, then narrow them down to smaller and smaller sections as you get your > bugs eliminated. > > Personally, I even keep a try...catch block covering my main function: > > [STAThread] > static void Main() { > Application.EnableVisualStyles(); > Application.SetCompatibleTextRenderingDefault(false); > try { > Application.Run(new Form1()); > } catch (Exception err) { > MessageBox.Show(err.ToString(), "Main() Error"); > } > } > > > "Frank Uray" wrote: > > > Hi > > > > No, the PlugIns do not use COM, > > but some of them are using Form.Invoke . > > > > I am guessing there is a problem in one of the PlugIns, > > but the question is, how can I find such errors ??? > > > > Best regards > > Frank Uray > > > > "jp2msft" wrote: > > > > > What do the plug-ins do? Are they COM objects? Maybe they are the cause. > > > Does your app have issues if the plug-in section of the code is commented > > > out? > > > > > > "Frank Uray" <FrankU***@discussions.microsoft.com> wrote in message > > > news:5A407FF4-F6B8-426C-A176-4D58B958FDA2@microsoft.com... > > > > Hi all > > > > > > > > I have a little problem with debugging ... > > > > I have build a application (MDI Container) with plugins, > > > > and now, for some reason, after about 1h the applications > > > > hangs, without error message ... > > > > > > > > I have tried to debug in visual studio (attach process) > > > > and I have seen the application is still running, > > > > it seams just the GUI is blocked ... > > > > But also when debugging, there is no exception rised ... ??? > > > > > > > > How can I find out what is happening ?? > > > > Any ideas? > > > > > > > > Thanks for any comments > > > > > > > > Frank Uray > > > > > > > > > Hi Frank,
How exactly are you debugging? When I see "the GUI is blocked, but I am able to debug" ...I get lost. Are you stepping through your code in Visual Studio or are you using some other programming tool? Show quoteHide quote "Frank Uray" wrote: > Hello > > Thanks again for your answer. > > I have tried this try-catch within the main, > but it does not help, still the same problem ... :-(( > > The GUI is blocked, but I am able to debug (attach to process) > the application ... ?? > > Best regards > Frank Uray > > > "jp2msft" wrote: > > > My best advice would be to start dropping try...catch routines all through > > your code: > > > > try { > > // code > > } catch (Exception err) { > > MessageBox.Show(err.ToString(), "Error at Line X"); // fill in the X > > } > > > > The ToString() method should tell you the line number (if you are in debug > > mode) where the error occurred. > > > > Start by making your try...catch routines encompass large sections of your > > code, then narrow them down to smaller and smaller sections as you get your > > bugs eliminated. > > > > Personally, I even keep a try...catch block covering my main function: > > > > [STAThread] > > static void Main() { > > Application.EnableVisualStyles(); > > Application.SetCompatibleTextRenderingDefault(false); > > try { > > Application.Run(new Form1()); > > } catch (Exception err) { > > MessageBox.Show(err.ToString(), "Main() Error"); > > } > > } > > > > > > "Frank Uray" wrote: > > > > > Hi > > > > > > No, the PlugIns do not use COM, > > > but some of them are using Form.Invoke . > > > > > > I am guessing there is a problem in one of the PlugIns, > > > but the question is, how can I find such errors ??? > > > > > > Best regards > > > Frank Uray > > > > > > "jp2msft" wrote: > > > > > > > What do the plug-ins do? Are they COM objects? Maybe they are the cause. > > > > Does your app have issues if the plug-in section of the code is commented > > > > out? > > > > > > > > "Frank Uray" <FrankU***@discussions.microsoft.com> wrote in message > > > > news:5A407FF4-F6B8-426C-A176-4D58B958FDA2@microsoft.com... > > > > > Hi all > > > > > > > > > > I have a little problem with debugging ... > > > > > I have build a application (MDI Container) with plugins, > > > > > and now, for some reason, after about 1h the applications > > > > > hangs, without error message ... > > > > > > > > > > I have tried to debug in visual studio (attach process) > > > > > and I have seen the application is still running, > > > > > it seams just the GUI is blocked ... > > > > > But also when debugging, there is no exception rised ... ??? > > > > > > > > > > How can I find out what is happening ?? > > > > > Any ideas? > > > > > > > > > > Thanks for any comments > > > > > > > > > > Frank Uray > > > > > > > > > > > > Not too sure what your app does so this may or may not be useful, but given
the symptoms you describe check for threads other than the UI thread trying to perform UI operations. If you can get a stack trace of all your threads and you see threads other than the UI thread stuck in a UI call that's a dead give away. This can be caused, for example, by an event handler enabling \ disabling a button or control on the front end. If the handler is called, let's say, in response to a network event then it will be raised on a non-UI thread. If it doesn't marshall itself to the UI thread your app's going to hang. HTH, Adam. Show quoteHide quote "Frank Uray" <FrankU***@discussions.microsoft.com> wrote in message news:5A407FF4-F6B8-426C-A176-4D58B958FDA2@microsoft.com... > Hi all > > I have a little problem with debugging ... > I have build a application (MDI Container) with plugins, > and now, for some reason, after about 1h the applications > hangs, without error message ... > > I have tried to debug in visual studio (attach process) > and I have seen the application is still running, > it seams just the GUI is blocked ... > But also when debugging, there is no exception rised ... ??? > > How can I find out what is happening ?? > Any ideas? > > Thanks for any comments > > Frank Uray
Other interesting topics
When to use delegates?
NNTP graphics DataGridView multiple tables timeout on http post when multiple posts in parallel ApplicationSettingsGroup EOF not detected C# / VB.NET code which takes a datetime in as parameter and returns a string DataGridView Add procedure separator lines in the .cs code Text editor ? |
|||||||||||||||||||||||