Where is *.vshost.exe coming from?

B

Brett Romero

I have a VS.NET 2005 solution with 10 projects. I have unbinded all
projects, closed and reopened the solution. When I build, via Nant, I
copy all of the PDB and DLLs to the EXE bin/debug folder. Source Safe
is not running. I see a myapp.vshost.exe in the bin/debug folder. I
cannot delete it. I can't kill that process either.

When I do a build, I want to clean out the bin/debug folder. However,
the myapp.vshost.exe file locks DLLs and prevents me from cleaning the
bin/debug folder. Because I'm building via Nant and not using VS.NET
Source Safe integration, I don't see where the *.vshost.exe file is
coming from. I have closed the solution and VS.NET but still get the
file.

Any ideas?

Thanks,
Brett
 
N

Nicholas Paldino [.NET/C# MVP]

Brett,

The vshost.exe file is created by VS.NET for you. This is a shell that
runs your program when you debug. One of the main purposes, if I recall
correctly, is so that it can set security correctly in case you want to run
in something other than full trust.

Hope this helps.
 
B

Brett Romero

It seems to lock these files randomly. What is the reason for holding
them as locked if I'm not debugging? How does the "clean" feature in
Studio work if they are locked?

Brett
 
M

Marina Levit [MVP]

I've found that as long as I keep VS open with that project, those files
will be locked. If you shut down the IDE, they go away.

I couldn't tell you the reason they stay locked. Why does it matter to you?
I've sort of largely ignored these files, and been fine so far.
 
B

Brett Romero

Why does it matter to you?

As I mentioned, I want to delete the files on every new build.

Brett
 
W

Willy Denoyette [MVP]

| >Why does it matter to you?
|
| As I mentioned, I want to delete the files on every new build.
|
| Brett
|

Don't use the hosting process then, you can turn it off in your project
settings.

Willy.
 
B

Brett Romero

Doesn't that turn off debugging capabilities and other features I need?
I don't want to loose features. Just stop the file locking.

Brett
 
W

Willy Denoyette [MVP]

I turn it off all the time, never had any problems while debugging. I turn
it off because I had too many issues with this, I want my application to run
in it's own process not in a host that keeps running and is supposed to
load/unload my application. Don't forget that when hosting your security
context is the context of the host, which may lead to surprises when you
change the context in your code.

Willy.

| Doesn't that turn off debugging capabilities and other features I need?
| I don't want to loose features. Just stop the file locking.
|
| Brett
|
 
S

scott blood

VSHOST.exe is the hosting process used by Visual Studio.

A copy of this is created every time you build you run your project
(currently i use F5). It is suppost to provide improved performance when
running your project from within the IDE. It also offers the ability to use
Partial Trust Debugging and design time expression evaluation.

Removing this process from the process list will cause problems when running
the IDE because Visual Studio requires this process indefinatly when your
project is in run mode.

Regards
Scott Blood
C# Developer
 
W

Willy Denoyette [MVP]

You don't have to remove it from the "process list" (that is kill it), you
need to disable the option in your project settings (see Debug options).
When it's disabled, VS will no longer spawns the host when debugging. This
option is only valuable on slower boxes as it speeds up the loading process
of an application when debugging, but on reasonable fast systems the
differences aren't visible at all.


Willy.


| VSHOST.exe is the hosting process used by Visual Studio.
|
| A copy of this is created every time you build you run your project
| (currently i use F5). It is suppost to provide improved performance when
| running your project from within the IDE. It also offers the ability to
use
| Partial Trust Debugging and design time expression evaluation.
|
| Removing this process from the process list will cause problems when
running
| the IDE because Visual Studio requires this process indefinatly when your
| project is in run mode.
|
| Regards
| Scott Blood
| C# Developer
|
| | >I turn it off all the time, never had any problems while debugging. I
turn
| > it off because I had too many issues with this, I want my application to
| > run
| > in it's own process not in a host that keeps running and is supposed to
| > load/unload my application. Don't forget that when hosting your security
| > context is the context of the host, which may lead to surprises when you
| > change the context in your code.
| >
| > Willy.
| >
| > | > | Doesn't that turn off debugging capabilities and other features I
need?
| > | I don't want to loose features. Just stop the file locking.
| > |
| > | Brett
| > |
| >
| >
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top