Visual Studio has insufficient privileges to debug

2020-07-11 06:44发布

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条回答
聊天终结者
2楼-- · 2020-07-11 06:53

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
查看更多
我只想做你的唯一
3楼-- · 2020-07-11 06:58

I've also encountered this problem. I don't know how to solve it permanently but I found a work-around.

  1. In VS, open the project's web properties. -Right click on your project. Then select properties. Select the Web tab.
  2. Select IIS Express instead of Local IIS.
  3. Run the Debugger

This worked for me. I hope it works for you too.

查看更多
男人必须洒脱
4楼-- · 2020-07-11 06:59

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"

查看更多
Melony?
5楼-- · 2020-07-11 07:05

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.

查看更多
淡お忘
6楼-- · 2020-07-11 07:07

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!

查看更多
Root(大扎)
7楼-- · 2020-07-11 07:07

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"

查看更多
登录 后发表回答