|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer|
How to: Publish Web Sites (Visual Studio)
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.
The Publish Web Site utility is not available in Visual Web Developer 2005 Express Edition.
Before publishing a Web site
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.
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.
For definitions of configuration settings, seeand .
To publish a Web site
On the Build menu, click Publish Web Site.
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.
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.
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.
Make any configuration changes that are necessary for your site. For more information, see. You might also want to encrypt specific configuration settings. For more information, see .