Walkthrough: Creating a One-Click Publish Profile
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Visual Studio 2010 lets you package a Web application with its dependent files and settings, and then use IIS remote management service to publish the application to a remote IIS server using One-Click Publish. You can create a publish profile for your host Web server or testing server and save the credentials securely so that you can later deploy or update a Web application by using any of the Publish profiles.
In order to run this walkthrough, you will need the following:
- Microsoft Visual Studio 2010.
One-Click Publish does not work for Web application projects that were created by using earlier versions of Visual Studio. To publish a Web application project that was created in an earlier version of Visual Studio, back up the existing project, and then open the project in Visual Studio 2010. You will then be prompted to convert the project to a Visual Studio 2010 project.
Creating a Web Application to Deploy
For this walkthrough, you can use an existing Web application or create a new one to use.
To create a new Web application project to package
Select Project from the File menu.
The New Project dialog box is displayed.
Select Web Node, and then select ASP.NET Web Application Project.
Visual Studio creates the Web application.
Creating a New Publish Profile
When you create a Web application, you can create publish profiles that are associated with that application. Publish profiles enable you to save logon credentials and Web application settings when you publish a Web application to an IIS server. You can create profiles for any number of deployment scenarios, including test, staging, and production servers.
For this walkthrough, you create a Publish profile for the host Web server that you intend to use to run your Web application. Because you are entering logon credentials, each profile you create will be unique to the server it is created for.
There are a number of ways to create a Publish profile in order to publish a Web application project. These options are available in the Publish Web dialog box, which is used to create the Publish profile. You can select these options:
MSDeploy publish. This option uses the features of MSDeploy to publish a Web application project, IIS settings, and other information to a host IIS server. This is the preferred method for publishing a Web application project.
FTP. This option uses the File Transfer Protocol (FTP) service in IIS to upload the Web application project files to a host server.
FrontPage Server Extensions (FPSE). This option uses FrontPage Server 2002 Extensions to publish the Web application project files to a host IIS server.
File system. This option creates a file structure and copies that file structure to the host IIS server.
To create a new Publish profile
Right click the project name in the Select Solution Explorer window.
The Publish Web dialog box is displayed.
In the Publish Profile text box, enter a name for the profile.
It is recommended that the name indicate the purpose or location where the profile is used, such as TestServer or DiscASPServer.
From the Publish Method drop-down list, select MSDeploy Publish.
This is the recommended selection when you deploy a Web application project.
Enter the Service URL, such as https://MyServer:8172/MSDeploy.axd.
This information is typically provided by a server administrator or the hosting company.
Enter the application name in the Site/Application field, such as MyDomain.com/MyApplication.
Select the Mark as IIS application on destination check box. This causes the application to be marked as an IIS application on the destination server.
Select the Do not delete extra files on destination check box.
If you do not select this check box, all files on the IIS Server under your application are deleted before publishing.
Enter the user name and password you use to access the account on the targeted server. This information is typically provided by the server administrator or hosting company.
The Publish Web dialog box closes.
Publishing a Web Application Using the One-Click Toolbar
After a Publish profile has been created, you can select that profile to publish a Web application from the One-Click Publish toolbar.
If you publish using the MSDeploy Publish option, only files that have changed since the last time the application was published are updated.
To use the One-Click toolbar to publish a Web application
From the main menu, select View, select Toolbars…, and then select Web One-Click Publish if it is not already checked.
You can also enable the One-Click toolbar by right-clicking the main menu and selecting Web One-Click Publish.
Select a publishing profile from the drop down menu on the One-Click toolbar.
Click the Publish Web button to publish the Web application project by using the profile you selected.