Note that there are some explanatory texts on larger screens.

plurals
  1. POWinApp Form Crash Without any Error or Exception .Net
    primarykey
    data
    text
    <p>I have a problem with My WinApp Form program which contain a tab Control with WebBrowser control DLL (GeckoFX).</p> <p>My application while running close without any exception or anything. It could happen after few minutes or max after 10 min. In visual studio I see application terminate with code 0. Anything. </p> <p>In program.cs I catch all this unhandled excpetion </p> <pre><code>` // Add the event handler for handling UI thread exceptions to the event. Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(UIThreadException); // Set the unhandled exception mode to force all Windows Forms errors to go through // our handler. Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); // Add the event handler for handling non-UI thread exceptions to the event. AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);` </code></pre> <p>I already Check in Windows Event logger for any error but it's clean. Just like the Program is terminated well. I don't know if it's Gecko DLL fault but I don't think so.</p> <p>I use httpWebRequest to download a list which contains some URL. </p> <p>Then I use a <code>Backgroundworker</code> which read the list of the URL , and invoke addTab Delegate Method Sleep a bit until page is loaded and continue with other AddTab Invoke. </p> <p>When the list is empty I check if in the DOM page there is a certain string Then in <code>Backgroundworker</code> Complete I Close All Tabs and Dispose them and I click on button1 which start the <code>Backgroundworker1.asyncall();</code></p> <p>Is there something wrong with my Logic? I will post code too, I need that it's too long but I really need understand where could be the error that terminate my application. If someone can help me to see why it crash without any error or anything I will appreciate that.</p> <pre><code>private void Start_Back_Click(object sender, EventArgs e) { List&lt;Links&gt; tempList = getListFromWeb(); if (!backgroundWorker1.IsBusy) { backgroundWorker1.RunWorkerAsync(tempGoogle); } } private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { List&lt;Links&gt; temp = (List&lt;Links&gt;)e.Argument; foreach (Links link in temp) { if (backgroundWorker1.CancellationPending) { e.Cancel = true; return; } _busy.WaitOne(); if (tabs.InvokeRequired) { m_addTab addTabInvoke = addTabUrl; Invoke(addTabInvoke, new Object[] { link.url, link.StringToSearch }); } } Thread.Sleep(2000); if (tabs.InvokeRequired) { foreach (Browser tempBrowser in ListCurrentBrowser) { if (backgroundWorker1.CancellationPending) { e.Cancel = true; return; } _busy.WaitOne(); Thread.Sleep(1000); m_SeachTab addSearchInvoke = addTabPSearch; Invoke(addSearchInvoke, tempBrowser); } } } private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { //Check Stuff Error and Cancelled if (e.Error != null) {... } else if (e.Cancelled) { ....} else //Else remove all tab { bool canRemove = this.TabCount &gt;= 1; if (canRemove) { WebBrowserTabPage tab = this.SelectedWebBrowserTagPage; this.TabPages.Remove(tab); tab.Dispose(); } **Start.Back.PerformClick();** //Click on button again to start another time the backgroundworker } </code></pre> <p>}</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload