views:

70

answers:

3

I have created a service in VS 2008 called EmailReader. I have compiled, installed and started the service. Its timer loop is writing records to a log file, so I can see that it is running. I am trying to attach to it in VS 2008, but the process name is greyed out in the list of available processes, and the name is "EmailReader.vshost.exe" instead of "EmailReader.exe".

There is probably a simple answer, but I don't know it. Do you?

+2  A: 

The vshost.exe is not the right exe which you want to attach to. It will be emailreader.exe itself.Try to attach to the service. A dialog box will open up with all services. Try checking the box which says show all processes from all users and also check the box which says show processes from all sessions.

Prashant
A: 

It's very likely that you are running the service under a different set of credentials than you are running Visual Studio. Make sure you've checked Show Processes For All Users. You won't be debugging a vshost, you need to debug the instance from the SCM.

Nissan Fan
A: 

First, there'd be two checkboxes in the Attach to Process dialog. Set both of them as checked. Click on the listbox where the processes are listed. As you press 'E' (as in your case) you'd see it highlight a process that starts with 'e', find the exe image name you've just built. Once you are there the attach button will automatically become enabled.

Ps: the exe name you've built will be the same exe with which you ran the installutil tool to install the service

deostroll