How to disable UAC using visual stuio 2010?
How to diable UAC using Vi开发者_StackOverflowsual Studio 2010 to run the compiled app without problems and witout using virtualization?
I mean run the app as administrator. (with shield icon)
You need to add an application manifest to your application to indicate to the operating system that it requires administrator privileges. This will cause your application to prompt for UAC elevation every time it's launched (regardless of whether it's launched from Visual Studio or not).
Be aware that applications running with Administrative privileges cannot be debugged from applications that are not running as Administrator. Meaning if you want to debug your application, you'll also have to run Visual Studio as Administrator.
Personally, I would suggest that you don't require Administrator privileges in your application and instead use an out-of-process COM object that is marked as Administrator to perform Administrative tasks. That way, your app can spend most of it's time as a non-Administrator and only elevate when actually required. See here for more information on that.
I don't think you can do this programatically on a per use basis. You must either disable it completley in windows or to upgrade your program work under UAC.
精彩评论