In vs2008 and vs2010, the method is relatively simple:
<1>. In the project, click "new item", select "Application List" (. manifest), and name the file by yourself,
<2> open the created configuration file with the extension. manifest and check the code. We can see the UAC option with annotations. What we need to change is the content of this node:
<Requestedexecutionlevel level = "asinvoker" UIAccess = "false"/> change asinvoker to requireadministrator
<3> open the project properties and select the configuration file created for you from "Application-resource ".
<4>. Generate one more time.
It is troublesome in vs2005 and has not been tested. Copy the online solution as follows:
<1> check whether app exists in properties. manifest file; if not, right-click the project and select "properties" from the menu. The page appears. On the "Security" tab, select "enable clickonce Security Settings" on the page, under properties, an app is automatically generated. manifest file. Open the app. manifest file and add
<Requestedprivileges>
<Requestedexecutionlevel level = "requireadministrator" cess = "false"/>
</Requestedprivileges>,
Re-compile,