Configurar la aplicación .NET para que se ejecute con niveles elevados

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.

preguntado el 10 de marzo de 12 a las 06:03

1 Respuestas

Forcing an application to always run as elevated is controlled by a setting in the requiredExecutionLevel 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.

respondido 10 mar '12, 06:03

Thanks. I just figured that out and was about to post it! It's certainly a lot simpler than the other convoluted solutions floating around the web. - Distorsionar

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.