about the handling of the process class

T

Tony Johansson

Hi!

When I run this program I saw that my current application was called
ProcessExample.vshost.
I was surprised over that this vshost was part of the processname.
I have thought that the application would have been called just
ProcessExample without this vshost.
So my question is why is the process of the application is called
ProcessExample.vshost and not
just ProcessExample ?

static void Main(string[] args)
{
string currentprocess = Process.GetCurrentProcess().ProcessName;
Process[] allLocalProcesses = Process.GetProcesses();
Console.WriteLine("Antal lokala processes är " +
allLocalProcesses.Length);
foreach (Process process in allLocalProcesses)
{
Console.WriteLine(process.ProcessName);
if (currentprocess == process.ProcessName)
{
Console.WriteLine(process.ProcessName + " is an instance of
this application");
}
}
}
//Tony
 
F

Family Tree Mike

Hi!

When I run this program I saw that my current application was called
ProcessExample.vshost.
I was surprised over that this vshost was part of the processname.
I have thought that the application would have been called just
ProcessExample without this vshost.
So my question is why is the process of the application is called
ProcessExample.vshost and not
just ProcessExample ?

static void Main(string[] args)
{
string currentprocess = Process.GetCurrentProcess().ProcessName;
Process[] allLocalProcesses = Process.GetProcesses();
Console.WriteLine("Antal lokala processes är " +
allLocalProcesses.Length);
foreach (Process process in allLocalProcesses)
{
Console.WriteLine(process.ProcessName);
if (currentprocess == process.ProcessName)
{
Console.WriteLine(process.ProcessName + " is an instance of
this application");
}
}
}
//Tony

Tony,

I believe that it is ProcessExample.vshost.exe, simply because you are
running in the debugger hosted by visual studio. If you navigate to the
bin/debug directory and run the executable, it should be named as you
expect.
 

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