xcopy是否可以部署自托管的ASP.NET Web API控制台应用程序?(Is it possible to xcopy deploy a self

编程入门 行业动态 更新时间:2024-10-24 03:22:25
xcopy是否可以部署自托管的ASP.NET Web API控制台应用程序?(Is it possible to xcopy deploy a self-hosted ASP.NET Web API console application?)

根据本教程 ,自托管的ASP.NET Web API应用程序必须以管理员身份运行,或者某人必须在将运行该应用程序的计算机上运行netsh http add urlacl命令。

我有一个控制台ASP.NET Web API应用程序,我希望部署过程尽可能简单。 有没有办法设置应用程序,以便可以部署xcopy?

According to this tutorial a self-hosted ASP.NET Web API application must be run as an administrator or someone must run the netsh http add urlacl command on the machine that will run the application.

I have a console ASP.NET Web API application and I want the deployment procedure to be as simple as possible. Is there a way to set up the application so it can be xcopy deployed?

最满意答案

这是Windows UAC限制。 如果您的应用程序需要侦听特定端口,则需要一些特权。 除非您以管理员身份运行应用程序,否则您必须运行netsh以授予运行应用程序的Windows帐户的权限以打开该端口。 您可以向控制台应用程序添加清单,以强制它始终以管理员身份运行。

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> <security> <requestedPrivileges> <requestedExecutionLevel level="requireAdministrator"></requestedExecutionLevel> </requestedPrivileges> </security> </trustInfo> </assembly>

问候 巴勃罗。

It's a Windows UAC restriction. Some privileges are required if your application needs to listen on a specific port. Unless you run the application as administrator, you will have to run netsh to give permissions to the windows account running the app to open the port. You can add a manifest to the console application to force it to run as administrator always.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> <security> <requestedPrivileges> <requestedExecutionLevel level="requireAdministrator"></requestedExecutionLevel> </requestedPrivileges> </security> </trustInfo> </assembly>

Regards Pablo.

更多推荐

程序,application,应用,Web,电脑培训,计算机培训,IT培训"/> <meta name="descrip

本文发布于:2023-08-02 20:44:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1381497.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:控制台   应用程序   NET   ASP   xcopy

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!