Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't debug windows Service VS2010 Win7

I am not able to debug any of my services after migrating from XP and VS2005, to Win7 and VS2010.

I can compile, I can install, I can run the services correctly.

But, I need to debug them. And when I try to attach to the process, I select the running process as I always did on VS2005, and I receive an error telling that I need admin permission.

I am already an administrator. Also, after searching a lot on the internet, I found that running VS2010 as an admin (via right click) should fix it, but I still can't.

I also tried to mark the checkbox on vslauncher.exe properties to run it always as administrator. The VS2010 window shows on top that it actually is running as admin, but again, when I try to attach to the process it says that I need admin rights.

Has anybody any idea about how to proceed?

like image 808
garfield185 Avatar asked Nov 26 '25 06:11

garfield185


1 Answers

It was a permissions problem. Win7 comes with a new security system, and I had to add to my profile (even being an admin) this permission:

Control panel -> Administrative tools -> Local Security policy -> Local Policies -> User rights Assignment -> Debug programs -> Add user or group .

And there, I added my own user. Reboot machine(Important!! Without rebooting, it won't work).

After that, I was able to attach processes to debug them. It's been a really long time to solve this, I hope to help other people that find this same problem.

Thanks everybody for your help.

like image 67
garfield185 Avatar answered Nov 27 '25 18:11

garfield185