1. In Visual Studio – Solution Explorer – right click the project name – property, find the “security” option, and check “enable ClickOnce security settings”:
2. At this point, there will be one more under the project“ app.manifest ”The file,
Select it and find the code snippet，
Replace it with:，
3. After correction, do not rush to recompile and build, and open the “properties security” interface again,
Remove the check in front of “enable ClickOnce security settings” before compiling and running. Otherwise, the program will report an error and cannot run.
4. Finally, save the changes and recompile the generated program.
When you open the program again, you will be prompted “user account control” to obtain administrator permissions to run, and click “yes” to obtain administrator permissions.
Link to the original text: https://www.cnblogs.com/yuluo/p/5718057.html