..


Sponsored Links

Deploying ASP.NET Applications

At a time when we practice our skills and develop ASP.NET web application the next step is to relate to the deployment (deployment in English) of the same. Fortunately, once again for this purpose, we find solace in Visual Studio.

As we mentioned at the beginning of the guide there are many website templates that you can use to develop and deploy our applications on various platforms

  • HTTP
    For such sites Visual Studio creates a virtual directory under IIS and uses IIS to intercept requests made in development. In this model the file for the fix (extension. Sln) file resides in a directory specified in the project settings in Visual Studio. The source code is is instead stored in the IIS virtual directory (... \ Inetpub \ wwwroot). Although this is not the most appropriate development model for many organizations, in some cases (such as site development by individual programmers) may be indicated.

  • FTP
    The option is to create FTP sites was introduced in the 2005 version of Visual Studio projects for those who want to manage remotely via an FTP server. For example, this option is recommended if you use a remote hosting service for your website. In this way you have a simple mechanism for transferring files from a development environment that hosts the site. For this type of site Visul Studio can connect to an FTP server on which you need to read and write privileges on the directory. If you have these permissions using Visual Studio, you can manage the contents of the FTP server.

  • File System
    This option is more oriented to the needs of developers. Using this model uses the web server built into Visual Studio itself to run and test the application and you can place the directory at any location on the local file system or on a shared folder on another computer. This model is the choice if you do not have access to IIS or you do not have administrative privileges on the system where you're developing your application. In this way the site is running locally on your system, but independent of IIS and you can develop and test the site on the file system. Then when the site is ready just create a virtual directory on IIS and point the same location on the file system where you will find the site.

For many programmers to deploy an application is something to think about the end of the development process and is an entirely separate. Instead of deploying a web application is an activity to be considered early in the process of development since, especially after the advent of cloud computing, you might not have access to the servers on which the application itself will be run.

For this reason, Visual Studio includes several new features that make the deployment of an application a much more manageable than in the past.

Among these new features include:

  • Packaging Web
  • Managing the web.config file for distribution
  • Distribution Database
  • How to publish One-Click

In previous versions of the development that did not include these features are usually created an installation package for deploying web applications. Although creating a package of this kind is preferable to simply copying files to a web server, the mechanism of the installation package could not take account of certain things such as the fact that the database schema may change in one of the distributions after the first application.

The new feature allows your web packaging to get around these problems. Using this tool you can create a compressed file or folder containing everything you need for the project is deployed on a web server.

A web package includes:

  • Content (web forms, controls, HTML, etc..)
  • Database schema and data of SQL Server (if the application requires them)
  • Settings of IIS
  • Other elements necessary to support the project (components to be installed in the global assembly cache, security certificates, information about the settings of registry entries, etc..)

Once you create a Web package you can copy it onto a server and install it manually (using the IIS Manager) or install it using the appropriate commands. In any case, as usual, the best way to understand everything is to proceed with an example. Therefore we create a new web application

and denominiamola WebApplicationDeploy.

The rectory is created starting ASP.NET application that contains, among other things, the Default.aspx Web Form

Assuming that our application is complete we click the right mouse button on the solution and choose the option Package / Publish Settings

We remove the checkmark on the option Create deployment packages as zip files (because we want that the files are placed in a directory and not in a compressed file) and save

Click again with the right mouse button on the solution and choose the option Build Deployment Package

Thus is created in the project directory (in the obj \ Debug \ Package \ PackageTemp) everything you need for application deployment

Then just copy all these elements in a directory to be used as a virtual directory of our site and set up IIS as we saw at the beginning of the guide to allow access to the site by users.

Help with Visual Studio ASP.Net
E-Learning
ASP (Advanced) ASP (Advanced)
Full course for creating dynamic Web sites. From 39 €.
ASP.NET (Course) ASP.NET (Course)
Full course for building Web applications from 49 €.
SQL and Database (Course) SQL and Database (Course)
Create and manage relational databases. From 39 €.
Sponsored Links