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
问题:
回答1:
If you're using Windows XP, the local security policy of the PC may be restricting non-administrators from running debuggers. By default, only administrators can debug.
Administrative tools -> Local Security Policy -> Local Policies -> User Rights Assignment -> "Debug programs"
回答2:
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!
回答3:
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.
回答4:
Spoulson is correct, uless you have the SeDebugPrivilege in your logon token, you can't debug a process runing as a service. To check, I use ProcesExp.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 tranted. 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
回答5:
I have seen this on Vista, but not on XP. To counter this in Vista, I just right-click the Visual Studio 2008 entry in my start menu, and choose "Run as Administrator"
回答6:
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.