I'm building .NET 3.5 app that I want to run elevated from the start. Its purpose is to configure and control a service.
I can't find any settings anywhere in Visual Studio 2010 that can be used to configure the app in such a way. You'd think there would be a checkbox somewhere in the project's properties that says "run elevated", but no such setting seems to exist.
Forcing an application to always run as elevated is controlled by a setting in the requestedExecutionLevel setting in the application's manifest file.
All you need to do is add a new item to your project and choose "Application Manifest". The correct settings will be listed in the file with comments listing was to set. Change the requestedExecutionLevel to requireAdministrator and you'll be set.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With