Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is major difference between dotnet publish and dotnet pack

Tags:

What is the major difference between dotnet pack and publish?

From Microsoft's description, my understanding is that pack creates a package while publish creates package + DLL.

Is this correct? If so, why not just always use publish and not use the DLL file if it is not needed.

like image 250
Lost Avatar asked May 22 '17 18:05

Lost


1 Answers

dotnet pack - Produces a NuGet package of your code.

That is the key difference - this will enable to publish to http://nuget.org, or to a nuget server that can be pulled down by other developers, or even for use with Octopus Deploy.

dotnet publish - Produces a .NET framework-dependent or self-contained application.

Keyword is "self-contained", a installer perhaps, or a folder that can be deployed by copying/pasting between hosts.

like image 119
t0mm13b Avatar answered Sep 22 '22 01:09

t0mm13b