I am writing a program in c# that requires it to be run as administrator only when certain actions are taken.
When the user clicks a button it checks if the application is running as an administrator and if it is not than it restarts the application as an administrator.
I don't want it to require admin access all the time since most of the application can be used without it.
The problem I am having is when I try to debug the application in VS2013 and click a button that requires admin access it restarts the program and Visual Studio stops debugging it.
Is there a setting or a debug configuration that will allow VS to always start debugging as administrator?