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?
Try this solution apply setting for shortcut (away run with administrator)
right click icon visual studio -> properties -> (Tab) Compatibility -> (Group) Setting -> (check) Run this program as an administrator -> Apply -> OK.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With