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

Viewed 32728

When I compile an application with VS2008 I sometimes end up with 2 identical config files:

  • *.exe.config
  • *.vshost.exe.config

What is the latter one for?

4 Answers

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.

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.

Related