From the course: Deploying ASP.NET Core Applications

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Publish your app via the command line

Publish your app via the command line

From the course: Deploying ASP.NET Core Applications

Start my 1-month free trial

Publish your app via the command line

- [Instructor] Deploying to IaaS via the command line is a useful alternative to using Visual Studio, especially if you want to script or automate the deployment process. The dotnet publish tool makes it easy to deploy an application using the command line or a script. I'll demonstrate how to use the tool from PowerShell to publish the application to IaaS. I've navigated to the project directory in PowerShell. First I need to run dotnet restore to restore any NuGet packages for the project, and then dotnet build just to make sure that it'll build correctly. Now I'll run dotnet publish, and then with the -c Release parameter, which will tell the application to build and publish in release mode. When the process is complete, the binaries will be placed in the bin directory. I can open up an explorer window to see where those landed. If I open up bin, release, netcoreapp1.1, which is the framework we're building on top of, and then the publish directory, all of the files and libraries…

Contents