dotnet核心应用以管理员身份运行 [英] dotnet core app run as administrator

查看:37
本文介绍了dotnet核心应用以管理员身份运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个dotnet控制台应用程序,该应用程序需要管理员特权才能运行.我找不到该怎么做.在常规项目中,我将添加一个app.manifest并设置

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.

我该怎么做?

推荐答案

.NET Core不支持此功能.

This is not supported on .NET Core.

.NET Core实现了(扩展的).NET Framework功能的子集,该功能是跨平台的.

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

许多非Windows平台不支持请求和接收提升特权的应用程序.因此,.NET Core不支持它.

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)

这篇关于dotnet核心应用以管理员身份运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆