Let’s say you have a .exe application builded from Visual Studio and the application always needs to be run from an administrator account. Windows Vista introduced the “User Account Control” (UAC) and such applications are marked with a special “shield” icon like this:
TL;DR-version:
To build such an .exe you just need to add a __“application.manifest” and request the needed permission like this:
The same approach works more or less for .NET Core 3 apps:
Add a “application manifest file”, change the requestedExecutionLevel and it should “work”
Be aware: For some unkown reasons the default name for the application manifest file will be “app1.manifest”. If you rename the file to “app.manifest”, make sure your .csproj is updated as well:
Robert Mühsig ist Webentwickler bei der T-Systems Multimedia Solutions GmbH in Dresden und wurde von Microsoft mit dem ASP.NET MVP Award ausgezeichnet.