Publishing with Visual Studio

We will learn to deploy an application using Visual Studio. If we right-click on the web node of our project, we can pick Publish, and Publish will allow us to pick a target. Visual Studio will ask you to provide the name of the publishing profile to create and store the publishing profile for future use:

Fig 09: Creating a publishing profile

We can choose Azure Web Apps, filesystem, and other mode of deployment. In Settings, we can also pick which configuration we will use and which of the DNX versions to use. Here, you will only see options that match what you specified in the project.json file under the frameworks section. Finally, we can Publish the application:

Fig 10: Choosing DNX version

When published, it first runs the prepare statement and then the prepublish in order to package it all up in the temporary folder, and then it literally copies it out to the filesystem. Once the publishing is successful, open the command-line interface and navigate to the publish folder.

Note that the folder includes the commands and shell scripts that are defined in the project file. Also, note that the approot folder contains the packages and the runtimes necessary for the application.

If you are on the Windows platform, we can use the web command to start the application. You can simply open a browser and navigate to localhost with the 5000 port, and we can see our application actually running. The application is running directly from the command shell and not under IIS.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.217.194.39