.Net Core如何工作dotnet发布命令 [英] .Net Core how works dotnet publish command

查看:311
本文介绍了.Net Core如何工作dotnet发布命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个解决方案,其中有一些针对net standard 2.0的项目,一个针对netcore 2.1的控制台应用程序项目。

I have a solution with some projects targeting net standard 2.0 and a console application project targeting netcore 2.1

我将其设置为输出文件夹 myFolder。
从visual studio生成我在以下位置获得所有dll:

I set as output folder "myFolder". Building from visual studio I get all dlls in :


  • myFolder\netstandard2.0

  • myFolder\netcoreapp2.1

我可以使用 dotnet build命令获得相同的结果。
现在,我需要控制台应用程序的exe文件。
所以我使用 dotnet publish -c Release -r win-x64 MySolution.sln命令。

I get the same using the "dotnet build" command. Now I need my console application's exe file. So i use "dotnet publish -c Release -r win-x64 MySolution.sln" command.

现在我得到了这个新目录 myFolder\netcoreapp2 .1\win-x64中找到所有dll和控制台应用程序的exe文件。

Now I get this new directory "myFolder\netcoreapp2.1\win-x64" where I find all dlls and the console application's exe file.

不够!

我再找到一个目录: myFolder\netcoreapp2.1\win-x64\publish,在那里我再次找到所有dll和控制台应用程序的exe文件。

I find one directory more: "myFolder\netcoreapp2.1\win-x64\publish" where I find again all dlls and the console application's exe file.

我想知道他们有什么意思。我阅读了文档命令,但是我没找到我的答案。

I wonder which meaning they have. I read the command documentation but I didn't find my answer.

有人照亮我吗?

推荐答案

根据文档


-o |-输出< OUTPUT_DIRECTORY>

指定输出目录的路径。如果未指定,则默认为./bin/ [配置] / [框架] / publish /(对于依赖框架的部署),或./bin/ [配置] / [framework] / [runtime] / publish /(对于自定义)

Specifies the path for the output directory. If not specified, it defaults to ./bin/[configuration]/[framework]/publish/ for a framework-dependent deployment or ./bin/[configuration]/[framework]/[runtime]/publish/ for a self-contained deployment.

dotnet publish -c Release -r win-x64 --output ./MyTargetFolder MySolution。 sln

这篇关于.Net Core如何工作dotnet发布命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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