从VS 2017发布.net核心应用

编程入门 行业动态 更新时间:2024-10-27 09:47:06
本文介绍了从VS 2017发布核心应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在Visual Studio 2017 Community Edition下创建一个新的解决方案,它主要是核心Web应用程序.

I am creating a new solution under Visual Studio 2017 Community Edition, it's mainly a core web application.

它可以完美运行,完全没有问题,但是我们希望将其部署到Debian机器上并且可以独立运行,因此我们在项目中添加了运行时标识符.到目前为止,到目前为止,问题是当我们要为我们拥有的任何平台发布应用程序(到目录)时,无法选择指定目标平台,并且创建的发布文件仅仅是程序集,本机模块.

It works perfectly, no problem at all, but we want to deploy it to a Debian machine and to be self contained, so we added the runtime identifiers to the project. So far so good, the problem comes when we want to publish the application (to a directory) for any of the platforms we have, there is no option to specify the target platform and the publish files created are just the assemblies, no native modules.

当然,如果我们使用dotnet publish -r (platform),它可以按预期工作,它将创建正确的平台文件,并且一切似乎都正常,但是必须转到命令行对其进行编译非常烦人.

Of course if we use dotnet publish -r (platform) it works as expected, it creates the correct platform files and everything seems to be ok, but is very annoying to have to go to command line to compile it.

问题是,如何使用Visual Studio 2017发布针对具体平台的独立应用程序?甚至有可能还是仍然没有?

So the question is, how can be published a self-contained application for a concrete platform using Visual Studio 2017? Is it even possible or this is still missing?

推荐答案

当前VS2017不会执行此操作,因此您必须转到命令行并运行它.

Currently VS2017 won't do this so you have to drop to the command line and run this.

dotnet publish -c release -r ubuntu.14.04-x64

显然是用ubuntu取代了您的debian风格.

Obviously replacing ubuntu for your debian flavour.

这也位于我的csproj文件中,您可能也需要它.

Also this is in my csproj file and you might need it too.

<OutputType>Exe</OutputType>

更多推荐

从VS 2017发布.net核心应用

本文发布于:2023-11-15 22:05:57,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1598370.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:核心   net

发布评论

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

>www.elefans.com

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