C# - Force .NET application to run as administrator

Forcing your .NET applcation to run as administrator is actually pretty straightforward. WIth a small web.config update your app will boot as admin by default.

Running .NET as Admin

First we want to modify the application manifest that is embedded in the program. This will work on Visual Studio 2008 and higher. If your project does not yet have a app manifest file, Go to Project > Add New Item, select "Application Manifest File".

After creating the file, change the requestedExecutionLevel value as shown below.