How to Use Web Deploy to deploy your website

This blog post will detail how to use Visual Studio 2010 to deploy your website or ASP.NET application to your Arvixe hosted site. Web Deploy allows you to publish your site quickly and easily without having to login to the control panel or FTP. For those not familiar with Web Deploy you can read more about it here: http://learn.iis.net/page.aspx/426/overview-of-web-deploy/

Arvixe offers Web Deploy service with all ASP/ASP.NET hosting packages.

Requirements:

i) You need to have Remote IIS Management enabled. You can enable it from the “Management” tab in your website properties in your Arvixe control panel. Inquire our staff if you run into any problems. The username and password you choose in that tab will be the username and password you use for Web Deploy.

If you are a new customer: Web Deploy is automatically setup for you along with Remote IIS when your account is created. To enable it login to your control panel and go to Websites > Click on your website > Click on the Management tab > Enter a username and password > Click Enable. From that point you can follow this blog tutorial on how to use web deploy.

If you are an existing customer: Web Deploy is setup on a per user/site request. Please submit a ticket to have Web Deploy enabled for your account. If you require it on more then one website, please list them in the ticket.

Note: The “allow untrusted certificate” option must be checked. Also, make sure you do not check the “Mark as IIS Application on Destination” option if you are deploying to the root as the root is already marked as an IIS application. Even when uploading to a subdirectory that’s already been made a virtual directory inside the control panel, leave this option unchecked.

4. Once you have the settings filled in click the “Publish” button. The log on the bottom of the screen will display all of the information pertaining to the upload (and whether it succeeds or fails). You should see the following when it’s finished deploying your content:

Now, you should be able to navigate to the URL and view the content you deployed.

To get your User name and password, go to the Control Panel, Management tab in Web Site Properties
There you will see the username, and can set your password.

IMPORTANT! As is, this will overwrite your production web.config with your debelopment seb.config, make sure you have a backup of it before you play.
If you want to configure so you keep it, do 2 things:
1. Leave extra files on dest: Ticked (see above)
2. Look in directory C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications
Find the file Microsoft.WebApplication.targets
Edit it (admin rights needed, and of course copy a backup)
Find the line

is there another setting I need to adjust? After I click “Publish” I see this error:

Error 1 Web deployment task failed.((2/5/2011 3:21:49 PM) An error occurred when the request was processed on the remote computer.)

(2/5/2011 3:21:49 PM) An error occurred when the request was processed on the remote computer.
The application pool that you are trying to use has the ‘managedRuntimeVersion’ property set to ‘v2.0’. This application requires ‘v4.0’.

How do you deploy an ASP.net website as an application in a subfolder if you have to de-select ‘mark as an iis application on destination?’ I”m trying to deploy separate asp.net applications to subfolders (eg. where ~/ resolves to the web application in its own subfolder). In IIS7 manager you just ‘add an application’ (as opposed to a virtual directory). That doesn’t seem possible with websitepanel. Has anyone been able to do this? To further illustrate what I am talking about you can see a post about it here: http://stackoverflow.com/questions/1516041/run-an-asp-net-website-in-a-subfolder

For me, this blog written by Ronald Craft and the first comment written by Bryce mislead me. It took me nearly three days to finally get my site: http://www.menucool.com working. I hope it will help if your case is similar to mine.
My first website, http://www.menubasic.com, works when I took the first comment approach written by Bryce. But my second website, http://www.menucool.com, doesn’t work with the approach even if I configure it exactly like my first site. Then Arvixe support gave this blog to me, but it doesn’t work. Finally I found the screenshot of Step 3 is misleading. It should be:
1. The Service URL should be: hazel.arvixe.com
2. The Site/application should be: menucool.com (my site)
3. The user name should be menucool.com_pub (neither menucool.com_admin nor menucool.com)

John: there have been some changes in control panel recently, one of which is that the web deploy username defaults to a name suffixed _pub (whereas until recently the default was _admin), also there is currently no option to change that username. Bryce’s comment is still correct, though, as it tells you how to find the username by going to the Management tab.

Thank you for the tutorial. I have a question though. Can we publish local databases that we use in the asp application to the server using web deploy. I saw an option in vS 2010 along those lines. If yes, what settings should be used?
Thank you.

Two weeks ago I was able to deploy from Visual Studio just fine, using the information in this post. Now however, I just get this error. Nothing has changed, as far as I know.

Error : Web deployment task failed.((1/12/2012 3:11:30 PM) An error occurred when the request was processed on the remote computer.)

(1/12/2012 3:11:30 PM) An error occurred when the request was processed on the remote computer.
The server experienced an issue processing the request. Contact the server administrator for more information.
Publish failed to deploy.

As I said, it was working fine just a couple of weeks ago (prior to the addition of the Publishing tab in the control panel). Any ideas?

Error 9 Web deployment task failed. ((1/22/2012 2:28:57 PM) An error occurred when the request was processed on the remote computer.)
(1/22/2012 2:28:57 PM) An error occurred when the request was processed on the remote computer.
Attempt to perform an unauthorized operation on file ‘4_0_30319’.

It turns out that recently Arvixe added a new tab under the website in the control panel called Publishing. On that tab I didn’t have Web Deploy Publishing enabled. I added a password and enabled Web Deploy and I was still having issues. Finally, I was able to put several things together and found that the box “Leave extra files on destination (do not delete)” had to be checked to make it work.