Application.DoEvents(); throwing System.IO.FileNotFoundException ?
-
Ive got the webbrowser control navigating in a foreach loop which doesn't contain any IO yet i get the following exception Exception:Thrown: "Could not find file 'C:\Users\Raymond\Desktop\TestProgram\bin\Debug\TestProgram.vshost.exe.config'." (System.IO.FileNotFoundException) A System.IO.FileNotFoundException was thrown: "Could not find file 'C:\Users\Raymond\Desktop\TestProgram\bin\Debug\TestProgram.vshost.exe.config'."
foreach (string ValueName in Regkey.GetValueNames())
{
Browser.Navigate("http://www.google.com");
System.DateTime ThisMoment = System.DateTime.Now;
System.TimeSpan duration = new System.TimeSpan(0, 0, 0, 0, 10000);
System.DateTime AfterWards = ThisMoment.Add(duration);while (Loaded != true || AfterWards >= ThisMoment) { Application.DoEvents(); Thread.Sleep(50); } }
with Browser.document completed set to the function below
private void BrowserCallback(object sender, WebBrowserDocumentCompletedEventArgs e)
{
Loaded = true;
}No IO is taking place and the path in the exception is correct it even happens whenh im not debuging :confused: Is there any way to fix this or get the foreach loop to wait until Browser.documentcompleted is fired without using a delay ?
-
Ive got the webbrowser control navigating in a foreach loop which doesn't contain any IO yet i get the following exception Exception:Thrown: "Could not find file 'C:\Users\Raymond\Desktop\TestProgram\bin\Debug\TestProgram.vshost.exe.config'." (System.IO.FileNotFoundException) A System.IO.FileNotFoundException was thrown: "Could not find file 'C:\Users\Raymond\Desktop\TestProgram\bin\Debug\TestProgram.vshost.exe.config'."
foreach (string ValueName in Regkey.GetValueNames())
{
Browser.Navigate("http://www.google.com");
System.DateTime ThisMoment = System.DateTime.Now;
System.TimeSpan duration = new System.TimeSpan(0, 0, 0, 0, 10000);
System.DateTime AfterWards = ThisMoment.Add(duration);while (Loaded != true || AfterWards >= ThisMoment) { Application.DoEvents(); Thread.Sleep(50); } }
with Browser.document completed set to the function below
private void BrowserCallback(object sender, WebBrowserDocumentCompletedEventArgs e)
{
Loaded = true;
}No IO is taking place and the path in the exception is correct it even happens whenh im not debuging :confused: Is there any way to fix this or get the foreach loop to wait until Browser.documentcompleted is fired without using a delay ?
You may not be doing any IO, but the debugging process is. The file that is missing is the config file for the debug process. While you're debugging, the executable that runs is called "myprogram.vshost.exe" and the config file it uses is called "myprogram.vshost.exe.config." Does your project contain a configuration file? I don't know the details, but it appears to be looking for some kind of configuration information for the application, and it's not finding it. If you use Google on the file name, it returns several links that describe the missing file, and ways to suppress its creation. But you may already have a setting in VS that is stopping it from being created, and your app really needs it. From my reading, by the way, it appears that these files are created even when you build a Release version, but there's no need to actually deploy them. Not a complete answer, I know, but at least it narrows the search some. Good luck! :-D
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
-
You may not be doing any IO, but the debugging process is. The file that is missing is the config file for the debug process. While you're debugging, the executable that runs is called "myprogram.vshost.exe" and the config file it uses is called "myprogram.vshost.exe.config." Does your project contain a configuration file? I don't know the details, but it appears to be looking for some kind of configuration information for the application, and it's not finding it. If you use Google on the file name, it returns several links that describe the missing file, and ways to suppress its creation. But you may already have a setting in VS that is stopping it from being created, and your app really needs it. From my reading, by the way, it appears that these files are created even when you build a Release version, but there's no need to actually deploy them. Not a complete answer, I know, but at least it narrows the search some. Good luck! :-D
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
Strange but adding a app.config file solved the problem :thumbsup:
modified on Sunday, June 27, 2010 12:47 PM
-
Ive got the webbrowser control navigating in a foreach loop which doesn't contain any IO yet i get the following exception Exception:Thrown: "Could not find file 'C:\Users\Raymond\Desktop\TestProgram\bin\Debug\TestProgram.vshost.exe.config'." (System.IO.FileNotFoundException) A System.IO.FileNotFoundException was thrown: "Could not find file 'C:\Users\Raymond\Desktop\TestProgram\bin\Debug\TestProgram.vshost.exe.config'."
foreach (string ValueName in Regkey.GetValueNames())
{
Browser.Navigate("http://www.google.com");
System.DateTime ThisMoment = System.DateTime.Now;
System.TimeSpan duration = new System.TimeSpan(0, 0, 0, 0, 10000);
System.DateTime AfterWards = ThisMoment.Add(duration);while (Loaded != true || AfterWards >= ThisMoment) { Application.DoEvents(); Thread.Sleep(50); } }
with Browser.document completed set to the function below
private void BrowserCallback(object sender, WebBrowserDocumentCompletedEventArgs e)
{
Loaded = true;
}No IO is taking place and the path in the exception is correct it even happens whenh im not debuging :confused: Is there any way to fix this or get the foreach loop to wait until Browser.documentcompleted is fired without using a delay ?
-
Strange but adding a app.config file solved the problem :thumbsup:
modified on Sunday, June 27, 2010 12:47 PM
I thought it might take something like that, but I've had apps with no app.config file that worked fine. Some do, some don't, and I don't yet know why. Glad it solved the problem! :-D
"A Journey of a Thousand Rest Stops Begins with a Single Movement"