I have developed a windows service and this is service is running on my local computer under my account. When I try to debug this service by attaching this as a process in visual studio 2008 I get “Unable to attach to the process. Visual Studio has insufficient privileges to debug this process. To debug this process, Visual Studio must be run as an administrator.” I have logged in to my system as administrator and so when VS 2008 is launched it is running as administrator not sure why I get this error. I am using Windows XP Pro sp3
6 Answers
I know this is old but I was having the same problem in VS2015. Turns out the only problem was that my code/solution was stored under my user documents folder which has the little padlock icon on it. I think that means those files were not available to the VS debug processes. Moving it to a less restricted folder fixed the problem. Hope this helps someone else - Oh and my first post on here!
Sounds like a couple of different things. First, check what user the process is running under, most likely admin or a domain admin. Change that to something less priviledged.
Also, it might be that you are connected to a domain and the domain admins have neutered the local administrator priviledges. In that case you need to get the IT department to fix this.
Spoulson is correct, unless you have the SeDebugPrivilege in your logon token, you can't debug a process running as a service. To check, I use procexp.exe from the SysInternals suite by double clicking the Visual Studio process and checking the Security tab. On the bottom you will see all privileges you have been granted. They start with a "Se" prefix.
Another thought would be to ensure you have all the JIT (Just In Time), debugger settings enabled under the Tools->Options->Debugger menu option in VS (Visual Studio for those who don't know).
- Rashad Rivera Omegus Prime, LLC
I've also encountered this problem. I don't know how to solve it permanently but I found a work-around.
- In VS, open the project's web properties. -Right click on your project. Then select properties. Select the Web tab.
- Select IIS Express instead of Local IIS.
- Run the Debugger
This worked for me. I hope it works for you too.