I'm building a ASP.NET Core app which I can publish using dotnet publish
. So far, so good.
I'm interested in packaging that app so I can publish it on a NuGet server. dotnet pack
, however, doesn't seem to contain enough information to recreate the website on its own -- just the dll file.
Is there a way to create a NuGet package, through dotnet pack
or some other method, or do I need to manually package the files in the output directory myself?
As of 1/2017, there's no way one step way to do this, though ASP.NET Core is so fresh at the moment that I'm still hoping for a newer and better answer.
The best way to create a single file package for a ASP.NET Core website is to publish your app using
dotnet publish
, and package the directory using a ZIP utility (or Octo.exe if you need a NuGet package for Octopus).Current tools as of 2017/1: Octopack, which uses NuGet, cannot package .NET Core projects. NuGet itself is a minimal tool which requires a manifest or project file to work, and
dotnet pack
will only pack up the source files, and not assets (see the answer below for ways around that).