about the handling of the process class

  • Thread starter Thread starter Tony Johansson
  • Start date Start date
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
 
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.
 
Back
Top