What is the *.vshost.exe.config file?

This file's sole purpose is to help debugging and hosting Process.Visual Studio hosting process improves debugger performance. It enables new debugger features, such as partial-trust debugging and design-time expression evaluation.

If you disable the hosting process, partial-trust debugging will not work even if partial-trust security is enabled on the Security page of Project Properties.

You can disable that by Project menu -> click Properties -> Debug tab -> Clear the Enable the Visual Studio hosting process check box. Design-time expression always uses the hosting process. Disabling the hosting process in the Project Properties disables design-time expression evaluation for Class Library projects.

For other project types, design-time expression evaluation is not disabled. Instead, Visual Studio starts the actual executable and uses it for design-time evaluation without the hosting process.


Here's a blog post that talks about the vshost process and its purpose.

http://blogs.msdn.com/dtemp/archive/2004/08/17/215764.aspx


I noticed something else about this behaviour.

Whilst VS WILL create a config called [appname].vshost.exe.config, the API call:

var s = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile

does not return this name, rather it returns: [appname].config

This was using VS2010. Not checked in VS2008


When debugging inside VS your application will be called [appname].vshost.exe and so the .vshost.exe.config file is where the .net runtime will look for the program's config.