Question

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?

Was it helpful?

Solution

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

OTHER TIPS

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.

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

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top