mishal153
mishal153

Reputation: 1554

mysterious exception "Could not find file 'D:\xxxx\bin\Debug\xxx.vshost.exe.config'."

I am new to WPF and .net. I have a WPF app which someone else had written earlier and AFAI remember it was working just fine some time back. But today i see this mysterious error when trying to build the app and run from debugger : Exception : "Could not find file 'D:\xxxx\bin\Debug\xxx.vshost.exe.config"

I am able to run the generated exe from outside debugger. I am getting the mentioned exception ONLY when trying to debug from VS2008.

Upvotes: 0

Views: 3590

Answers (3)

Gourav_Garg
Gourav_Garg

Reputation: 41

I have faced same problem, It comes when we migrate our code from vs2005 to vs2013 or vs2015, for resolving this problem go in your bin folder in vs solution there you will see vshost.exe reference is missing, remove all reference related to vshost, then rebuild your application. :) I saw previous answer on stack overflow, so my suggestion is 1. don't try disabling visual studio hosting. 2. don't try to build solution in release mode. these both will not work.

Upvotes: 0

Phil Sandler
Phil Sandler

Reputation: 28016

First try doing a clean/rebuild. Also try closing Visual Studio and deleting the debug folder completely, then restarting and rebuilding.

Assuming that doesn't do it: to solve your short term problem, try going to the properties of your project, then to the Debug tab, and uncheck "Enable the Visual Studio Hosting Process". This should remove all reliance on the vshost.exe and the config file that gets generated for it. If the error above is your only problem, that should at least let you run in debug mode.

I'm guessing this is a locked file, permission problem, of file corruption problem. I've never heard of anyone having problems with the VSHost except on really slow machines.

Upvotes: 1

mishal153
mishal153

Reputation: 1554

I'm not sure what is the reason for the exception but I figured how to fix it. Basically I had enabled "throw" checkbox under debug->exceptions, and that was what started the problem. Still don't know why vshost.exe looks for a config file by default.

Upvotes: 0

Related Questions