Search code examples
c#.net-coreuac

dotnet core app run as administrator


I have a dotnet console application that requires administrator privileges to run. I can't find how to do this. In a regular project I would add a app.manifest and set

<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />

but I can't figure how to embed this in the build.

How do I do this?


Solution

  • This is not supported on .NET Core.

    .NET Core implements that (extended) subset of .NET Framework features which are known to be cross-platform.

    An application requesting and receiving elevate privileges is not supported on many non-Windows platforms. Hence it is not supported by .NET Core.

    (Dropping privileges, on the other hand, might be supported by more platforms)