Search code examples
c#visual-studio-2008visual-studio-debugging

Debug as User from Visual Studios run as Administrator


I must run Visual Studios 2008 as an administrator to compile legacy code I am working on. However, an issue was found that occasionally causes an error to occur when the app is run without admin privileges.

I was wondering if there was a way to debug a program with User privileges while running Visual Studios under Administrator? This would allow me to track down and fix the bug.

Thank you.


Solution

  • Start the program outside of Visual Studio (double click it), and make sure it is built for debug with the correct symbols. Open up Visual Studio as an Administrator and your solution, then in the menu bar select "Debug", and "Attach to Process".

    Find your process in the list of processes displayed, select it, and attach.