VS Development WinForm Settings WinForm get admin rights start

Source: Internet
Author: User

The registry access fails because you need to set the boot entry without administrator rights

C # Run as Administrator WinForm program reprint https://www.bbsmax.com/A/obzbkKrQJE/The original 2016-07-29 of the fish Luo

Recently helped customers develop the WinForm client, part of the process of use, there will be "system files not found" error message.

After debugging, it is OK to run the direct administrator right when the program is working on the configuration file and the system permissions are causing the error.

Consider the convenience of user actions, set to get system administrator permissions by default for each run, following the setup steps.

1. In visual Studio--Solution Explorer--right-click the project name-Properties, find the "security" option, tick "Enable ClickOnce Security Settings":

2, at this time, under the project will be more than a "app.manifest" of the file,

Select it and locate the code snippet <requestedexecutionlevel level= "AsInvoker" uiaccess= "false"/>

Change it to: <requestedexecutionlevel level= "Requireadministrator" uiaccess= "false"/>


3, after correcting, do not rush to recompile the build, again open the "Properties-Security" interface,

Remove the check in front of "Enable ClickOnce security Settings" before compiling and running. Otherwise, the program will not be able to run error.

4. Finally, save the changes and recompile the build program.

When the program is opened again, "User Account Control" will be prompted for administrator privileges to run, click "Yes" to get administrator rights.

VS Development WinForm Settings WinForm get admin rights start

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.