06. Deployment Guide

Published on December 2016 | Categories: Documents | Downloads: 50 | Comments: 0 | Views: 354
of 6
Download PDF   Embed   Report

asp.net mvc deployment guide

Comments

Content

Project Deployment Guide

S o far you ’ ve only been testing your ASP.NET MVC web application on your local machine, the development is not complete as your application does not allow external users to connect and user the application. To allow access from external users, you have to deploy your web application to an external production server capable of handling request from multiple internet users. This section will walk you through the deployment process using Visual Studio Express 2012 for Web.

Prepare the "Web.Release" Configuration File
You can find the "Web.config" file in the solution explorer. The file is an XML document that defines configuration information regarding the web application. When your web application is running on your local machine or the production server, the server will look into the "Web.config" file and act according to its configuration, e.g. connect to the database, load the corresponding helpers, etc. There are 2 sets of configurations under the "Web.config" file: the "Web.Debug.config" file defines the configuration of your local computer, and the "Web.Release.config" file defines the configuration of your production server. Unlike your local machine, the production server uses a slightly different mechanism to connect to the database files, thus you have to modify the "Web.Release.config" file to inclide the production server’s database configurations. You need to specify a different connection string for your web application’s databases running under the production server. To change the connection string, you have to implement an "appsetting transformation" in the "Web.Release.config" file. N ow, open the "Web .R elease . config " file in your project and delete everything inside. Download the "Web.Release.config" file from Moodle under Mini–Project, then copy and paste the entirety of its content to your empty "Web.Release.config" file.

Figure 218: Web.config File in Project Solution

150

planning , designing , and programming for web application

Personalize the "Web.Release.config" File
U pon pasting the content into your "Web .R elease . config ", customize the content with your own UID and Entity Framework Model. Refer to figure 219, change the highlighted sections as instructed on the figure.

Figure 219: Modifications to "Web.Release.config"

A fter making these changes, save the "Web.Release.config" file now and proceed to change the publish settings.

project deployment guide

151

Specify The Publish Setting

R efer to figure 220, select "Project → ∗Project∗ Properties" to open the project properties page.
Figure 220: Open the Project Properties Page

F or the "Package /P ublish Web " options, select "Release" configuration, and select "All files in this project folder" so that all your images and the membership account database can also be deployed.

Figure 221: Release Configuration for Web Publishing

152

planning , designing , and programming for web application

Publish to File System
P ublish your web application by right–clicking on the name of the ASP.NET MVC web application project then select "Publish"
Figure 222: Right–Click & Select Publish

C reate a new publish profile by clicking on the drop–down list and select "New Profile"

Figure 223: Create a New Publish Profile

N ame your new publish profile so that you can simply reuse the profile later on
Figure 224: Give a Name to Your New Publish Profile

project deployment guide

153

U se "File System" as the publish method, then select a folder in your system to store the published files. To avoid confusion, it is better to select an empty folder to host your published files. When you are all set, select "Next" instead of "Publish"

Figure 225: Publish using "File System" to a Folder

E xpand the "File Publish Options", tick the option to "Delete all existing files prior to publish". Now you can select "Publish" to publish your website to the folder of your choice

Figure 226: Delete Existing Files Prior to Publish

Output Signaling Publish was Successful 2>Site was published successfully file:///U:/Publish 2> ========== Build: 1 succeeded, 0 failed, 0 up–to–date, 0 skipped ========== ========== Publish: 1 succeeded, 0 failed, 0 skipped ==========

154

planning , designing , and programming for web application

Publish to Production Server using FTP Client

1. Refer to figure 227, open the FileZilla FTP Client and enter the production server login information: Production Server Login Information • Host: imse2016.imse.hku.hk • Username: imse2016.imse.hku.hk|your_imse_computer_login – e.g. imse2016.imse.hku.hk|2012123456 • Password: your_imse_computer_password • Port: 2255

Figure 227: Graphical Example of the use of FileZilla FTP Client

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close