tags:

views:

36

answers:

2

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.

A: 

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 edebug 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 exception on really slow machines.

Phil Sandler
I am experimenting around a bit and I see that if I add a .settings file to the project, turn on its "copy to output folder" property, and then build, then the bug goes away. Thats because a config file is created automatically. Im looking into csproj if i can find something that indicates that a .config is always expected. Will try ur suggestion too.
mishal153
Clea/rebuild did not help. But i suspect this is case of corrupted csproj. will update once i have the answer
mishal153
A: 

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.

mishal153