6

I am trying to debug a service in VS 2005 running. Service is running under SYSTEM username.

I have opened VS as administrator.

The error I am getting is:

Unable to attach the process. The system cannot find the file specified

I am running on Windows Vista.

abatishchev
  • 98,240
  • 88
  • 296
  • 433
anand
  • 11,071
  • 28
  • 101
  • 159

2 Answers2

5

Maybe the program you are trying to debug is using admin privileges but visual studio doesn't have admin rights.

run visual studio as administrator, even if you are logged in as administrator it doesn't automatically have admin privileges.

you can do this quickly by right clicking on the short cut of Visual Studio and click Run as Administrator.

Or you can make it automatically run as admin by right clicking the shortcut and choosing properties. Choose Compatibility -> Privilege Level -> Run this program as administrator

pm101
  • 1,309
  • 10
  • 30
0

Try to check Local Security Policy, make sure that Administrators(or your user) have "Debug Programs" permission (from Security Settings -> Local Policies -> User Rights Assignment).

andrei m
  • 1,157
  • 10
  • 15
  • 1
    I opened Debug Program Properties under User Right Assignment .Its not editable and giving message " This setting is not compatible with computers running Windows 2000 Service Pack 1 or earlier. Apply group policy objects containing this setting only to computers running a later version of the operating system" – anand Oct 22 '10 at 11:31
  • It's strange that Windows Vista gives you that message. Are you logged in with an administrator account when you try to make those changes? – andrei m Oct 22 '10 at 11:45
  • What if you try to run the service under your account. The rights I have mentioned before are only required if you try to attach a debugger to any process or to the kernel. – andrei m Oct 22 '10 at 12:08
  • If you think that is not related to the account that you are using, please check also http://stackoverflow.com/questions/2026853/unable-to-attach-to-created-process-with-visual-studio-2005 and see if it helps. – andrei m Oct 22 '10 at 13:09
  • @anand did you find any solution? I have the same issue on windows 10 – John Demetriou Nov 30 '20 at 14:47