Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
programming4us
Windows 7

Visual Studio 2010 : Deploying Web Applications

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
7/21/2011 4:44:24 PM
Deploying Web applications is more complicated than deploying Windows applications. One key difference is what occurs during the build process. Windows applications are compiled into assemblies. You can distribute those assemblies by any means you want. Visual Studio provides a number of tools to assist with the distribution of Windows assemblies, as described in the preceding section.

Web sites are different. When you use the Build command with a Web site, Visual Studio compiles the page only for testing. You can't deploy the output created from the Build command — and you don't need to. Because ASP.NET Web sites are compiled on demand when users access the Web site, you can just copy and paste your Web site, if you want.

You may want to compile your Web sites before you deploy them, which is often called precompiling. Precompiled Web sites have these benefits:

  • They start faster because no performance hit occurs while the requested page compiles.

  • Source code isn't deployed to the Web server; only assemblies and static files are.

  • You get feedback from compiler errors before the Web site is deployed.

Next, the deployment begins. Web sites often have two stages of deployment:

  • Test server: When a Web site is first created, it may be initially deployed to a test server. Several developers and testers can access the test site. The test site usually remains up after the site is deployed to production. The test site provides a working copy of the production Web site, where changes can be made.

  • Production server: After a site is ready to go live, it's published to a production Web server.

In reality, several versions of the Web site can run on different test servers. Developers can also have local copies of the site running on their development machines. They may deploy their local copies to the test server.

Because of the nature of Web sites, they're often changed more frequently than Windows applications. Changes are usually made to a single page or a set of pages, and then only those changes are deployed. In other cases, the entire Web site may be deployed.

NOTE

Making frequent changes to the structure, layout, and design of a Web site can be disruptive to your site's visitors. As a result, more firms are starting to limit the number of changes they make to the site. Rather than change the site, firms are creating fluid sites that use content databases and configuration files to control the site's content and flow. Rather than change the Web site when you want to change content or the site flow, changes are made to content databases or configuration files.

Whether you're deploying to a test server or a production Web server, Visual Studio provides several options for deploying Web sites:

  • Web setup project: Packages your Web site by using an installer that you then execute on the Web server

  • Copy Web Site tool: Copies and synchronizes sites between a local store and a server

  • Publish Web Site: Precompiles the Web site and copies it to the target of your choice

  • Web Deployment Projects: This add-in gives you the most flexibility in precompiling your Web site

You can also just copy and paste your files from your test server to production. The major drawback of copy-and-paste strategies is that you can easily make mistakes.

1. Using the Publish Web Site utility

To use the Publish Web Site utility in Visual Studio, follow these steps:

  1. Open your Web site in Visual Studio.

  2. Choose Build=>Publish Web Site.

    The Publish Web Site dialog box, shown in Figure 1, appears.

  3. Specify a target location where the Web site should be copied.

    You can enter or browse to a URL, Universal Naming Convention (UNC), or local file path.

  4. Select the Allow This Precompiled Site to Be Updateable option.

    This feature copies your ASPX files as-is to the Web site. You can update these pages later without having to recompile and deploy the entire site.

  5. Click OK.

    All code-behind files are compiled into a single assembly. The assembly, ASPX files, and static files (such as images) are copied to the target location that you specify in Step 3.

Figure 1. All necessary files will be published with your Web site.

Make a backup of your production Web site before deploying a new Web site. If the new site doesn't work, you can quickly roll back.


2. Handling web.config files for testing and production

A common challenge when you're deploying Web sites is not overwriting the web.config file. The web.config file on a test server usually has different settings than on a production server. For example, the test server may have connection strings that point to test databases. Visual Studio 2010 automatically creates a web.debug.config and web.release.config file for you and gives you control over precompilation and other deployment settings.

To configure deployment of an ASP.NET Web project, follow these steps:

  1. Choose Build=>Publish Web Site.

    The Publish Web dialog box appears, as shown in Figure 2.

  2. Choose Publish.

    Visual Studio creates a web.release.config file and publishes the Web site with your settings.

You configure a group of property page settings for each build configuration. For example, you likely don't want to use the deployment project with your debug build configuration. You can create different deployment settings for staging and release build configurations.

Build your site by using the release configuration. The web.config file is merged with the .config file. And you have a release version of your Web site that you can deploy to your production server, using whatever method suits you.

Figure 2. The Publish Web dialog box.
Other -----------------
- Visual Studio 2010 : Deploying Smart Client Applications (part 2) - Making a Windows Installer
- Visual Studio 2010 : Deploying Smart Client Applications (part 1) - From No Touch to ClickOnce
- Microsoft Visio 2010 : Applying Themes to Your Diagrams (part 2)
- Microsoft Visio 2010 : Applying Themes to Your Diagrams (part 1)
- Microsoft Visio 2010 : Turning Off the Grid
- Managing Disks : Using the Disk Management Utility (part 2) - Understanding the Disk Management Utility
- Managing Disks : Using the Disk Management Utility (part 1) - Using the Microsoft Management Console
- Managing Disks : Configuring File Systems & Configuring Disk Storage
- Microsoft Excel 2010 : Saving and Managing a Chart Template
- Microsoft Excel 2010 : Adding and Deleting a Data Series
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server