How to: Publish Web Sites

Publishing a Web site compiles the executable files in the Web site and then writes the output to a folder that you specify. For more information, see Publishing Web Sites.


The Publish Web Site utility is not available in Microsoft Visual Web Developer Express.

Before publishing a Web site

  1. Check the configuration of your original site and make note of any settings that need to exist at the remote location. Specifically, check settings such as connection strings, membership settings, and other security settings.

  2. Check the configuration of your original site and make note of any settings that need to be changed on the published Web site. For example, you might want to disable debugging, tracing, and custom errors after you publish your Web site.

    Because configuration settings are inherited, you might need to look at the Machine.config file or the root Web.config file in the SystemRoot\Microsoft.NET\Framework\version\CONFIG directory as well as any Web.config files in your application. If you do not have permission to view the root configuration files, you can output a file that contains a complete list of configuration settings for your Web site, formatted as a proper configuration file, using the code example in How to: View Inherited and Local Configuration Settings Programmatically.

    For definitions of configuration settings, see General Configuration Settings (ASP.NET) and ASP.NET Configuration Settings.

To publish a Web site

  1. On the Build menu, click Publish Web Site.

  2. In the Publish Web Site dialog box, click the ellipsis button (…) to browse to the location to which you want to publish the Web site.

    You can write the Web site output to a local or shared folder, to an FTP site, or to a Web site that you access with a URL. You must have Create and Write permissions in the target location.

  3. To be able to change the layout (but not the code) of .aspx files after publishing the Web site, select the Allow this precompiled site to be updateable check box.

  4. To name strongly named assemblies using a key file or a key container, select the Enable strong naming on precompiled assemblies check box, and then click OK.

    Publishing status is displayed in the taskbar. Depending on the connection speed, the size of the site and the types of content files, publishing time can vary. When publishing is completed, the status of Publish succeeded is displayed.

  5. Make any configuration changes that are necessary for your site. For more information, see How to: Configure Published Web Sites. You might also want to encrypt specific configuration settings. For more information, see Encrypting Configuration Information Using Protected Configuration.

See Also


Walkthrough: Publishing a Web Site

How to: Configure Published Web Sites


Publishing Web Sites

Editing ASP.NET Configuration Files

Other Resources

Administering ASP.NET Web Sites