Cloud Service >> Knowledgebase >> Plesk >> How to Publish Using Web Deploy with Plesk Control Panel in Visual Studio?
submit query

Cut Hosting Costs! Submit Query Today!

How to Publish Using Web Deploy with Plesk Control Panel in Visual Studio?

Web deployment is most often described as complex, and even the simplest web deployment can pose a challenge to even the most experienced web developer. An important thing that newcomers who are about to create their first web application should know is that web deployment can be a rather complicated business, even when it comes to deploying the simplest web application. 

In this article, you are going to learn how to deploy Websites or Applications on a Web Server that is controlled by the Plesk Control Panel using Web Deploy in Visual Studio.

Let’s Start From Basics

We should first familiarise ourselves with Web Deploy and Plesk, which are fundamental concepts to work with. Web Deploy (formerly AJAX-Powered Web Form Factor) is a tool by Microsoft that enables the management, migration, and deployment of websites and web applications. 

Plesk, however, is a popular web hosting operating system that enables one to control thousands of hosts on a single MASCHINE. Thus, this combination of two tools provides web application deployment that is effective, secure, and uncomplicated.

Setting Up Your Environment

The first step in deploying your application is setting up your environment. Ensure you have Visual Studio installed on your development machine. You’ll also need access to a server with Plesk installed and the Web Deploy functionality enabled. Here's how you can prepare:

Install Visual Studio: If you haven’t already, download and install Visual Studio from the official Microsoft website. Ensure that the Web Development feature is included during the installation.

Configure Plesk for Web Deploy: Log in to your Plesk control panel. Go to the 'Extensions' section and install the 'Web Deploy' extension if it’s not already installed. After installation, go to your domain’s hosting settings and enable 'Web Deploy publishing'. This step typically requires administrative privileges.

Get Publishing Settings: Once Web Deploy is enabled, download the publishing settings from Plesk. This can usually be done from the website’s dashboard within Plesk. The file you download will have all the necessary settings to configure the deployment in Visual Studio.

Configuring Visual Studio

With your environment set up, the next step is to configure Visual Studio to use the downloaded publishing settings.

Open Your Project: Launch Visual Studio and open the project you wish to deploy.

Import Publishing Settings: In Visual Studio, right-click on your project in the Solution Explorer and select 'Publish'. In the Publish window, choose 'Import Profile' and navigate to the publishing settings file you downloaded from Plesk. This will automatically fill in the server details, credentials, and other necessary settings.

Verify Settings: Check the connection by clicking on 'Validate Connection'. This ensures that Visual Studio can communicate with your Plesk server using Web Deploy.

Deploying Your Application

Now that everything is configured, deploying your application is relatively straightforward.

Review Publish Settings: Before you publish, review all settings, such as the configuration (Release or Debug), target framework, and database settings (if your application uses one). Make any necessary adjustments.

Publish: Once you're satisfied with the settings, click on 'Publish.' Visual Studio will begin deploying your application to the server. You can view the progress in the Output window within Visual Studio.

Verify Deployment: Once deployment is complete, navigate to your application’s URL to verify that everything is working as expected. Check functionality and database connectivity (if applicable).

Troubleshooting Common Issues

Deploying applications can come with a set of challenges. Here are a few common issues and how to troubleshoot them:

Validation Errors: If you receive errors during the 'Validate Connection' step, double-check your username, password, and server details. Ensure that the Web Deploy service is running on your server.

Firewall Settings: Sometimes, deployments can fail due to firewall settings on your server blocking Web Deploy operations. Ensure that the appropriate ports are open (the default is TCP port 8172 for Web Deploy)
Permissions Issues: Make sure that the user account used for deployment has the necessary permissions to write to the folder where the web application is hosted on the server.

Final Words

Here are some of the ways to deploy your web applications without much stress: Through using the Visual Studio and Plesk tools, you can establish quite an effective method of deployment that does a great deal to eliminate the issues connected with the organizational facet of getting your apps online. Here is what you need to do depending on your environment, followed by what will happen and why with easy-to-follow examples: By following the steps outlined above, you shall be able to deploy your projects with ease hence spending more time writing your codes.

Cut Hosting Costs! Submit Query Today!

Grow With Us

Let’s talk about the future, and make it happen!