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

查看:32
本文介绍了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

但我不知道如何将其嵌入到构建中.

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天全站免登陆