views:

159

answers:

1

I have an application that runs as a service, and dynamically creates and publishes windows performance (perfmon) counters.

When I run the application under my own account (as a service) which has administrative privileges, I get the following error: 714: The specified registry key is referenced by a predefined handle.

When I run the application from the command line, no error is produced.

I believe that this is a result of UAC, but I don't particularly want to disable UAC altogether.

Any ideas?

A: 

It is not enough just to be logged in as an administrator. The service needs to have an embedded manifest that sets the requestedExecutionLevel to requireAdministrator.

epotter