0

I am attempting to publish a project of mine in Visual C# 2010 Express Edition. This is what an excerpt of my manifest file looks like-

<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />

I need to have this set, as my program is editing the registry. So when I go to publish it, I get an error saying that "ClickOnce doesn't support the request execution level of requireAdministrator". So I disable ClickOnce under the Security tab and then go to publish it again, but I get the same error. I go and check the Security tab and sure enough, ClickOnce is enabled- even though I disabled it. It appears that every time you attempt to publish a project, it's enabled. Is there any way to publish my project and have the executionlevel of requireAdministrator enabled? Thanks, help is appreciated.

TheUnrealMegashark
  • 309
  • 1
  • 6
  • 19

1 Answers1

1

It is designed that requireAdministrator and ClickOnce cannot operate together, due to security conserns.

ClickOnce / Vista / UAC - ClickOnce is designed to install applications in a secure, per user cache with the benefit being that you do not require administrative permissions to install the VS part of a Click Once deployed applications. Click once applications do not attempt to elevate to admin privileges at runtime because they can expose the client to security elevation attacks. It is by design. We do not have any work around for this as of now.

http://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/2dfd23ee-ebfa-412c-a5dd-761ec1b55683/problems-embedding-manifest-for-uac-execution-level-for-clickonce-application

If you don't want to use ClickOnce, you can turn it off by unchecking Enable ClickOnce security settings in the security tab of the project properties.

Daniel Abou Chleih
  • 2,440
  • 2
  • 19
  • 31
  • I disable `ClickOnce` but when I want to publish it automatically enables. what should I do? – No.BoD Oct 16 '22 at 15:02