Lots can go wrong with this simple task. Basically, you want to create a publishing profile within Visual Studio – but unless you are setup correctly on the IIS Server, you will not be able to create this profile. The three steps that you need to address include:

  1. Step 1 – Install and Enable supporting services 
  2. Step 2 – Configure Web Deploy Publishing (on IIS). This creates a deployment file that you can use to help configure Visual Studio’s publish.
  3. Step 3 – Import the deployment file configuration into Visual Studio – and you should be all set.

 

Step 1 – Install and Enable supporting services and components 

a) The Web Management Service needs to be installed and running (see screenshot below).

 

              b) Web Deploy needs to be installed (The best way to obtain this might be via Microsoft’s Web Platform Installer – see screenshot below).

Step 2 – Configure Web Deploy Publishing (on IIS). This creates a deployment file that you can use to help configure Visual Studio’s publish.

Right click the website node–>Deploy–>Configure Web Deploy Publishing. This should prompt you for users (either domain or local users) that can ‘web-deploy’. See screenshot below. Once this step is successfully done, you are done with your SERVER  – and ready to move to Visual Studio. You will need to either export the file (deployment file that is created on IIS server) or just note the deployment values that will be needed. The deployment URL is key – and will trip you up if you try an incorrect combination. 

web deploy for publishing from Visual Studio

You will need these ‘deployment settings’ from IIS to import into Visual Studio – as you create a Publishing Profile (right click your web app only (NOT Your top level solution) –>Publish)

publish profile visual studio - settings from IIS deployment file

Summary

These are some of the steps that tripped me up while trying to get publishing to work directly from Visual Studio to my IIS Server. Don’t feel too bad if you wasted an afternoon or two trying to get this to work…

Anuj holds professional certifications in Google Cloud, AWS as well as certifications in Docker and App Performance Tools such as New Relic. He specializes in Cloud Security, Data Encryption and Container Technologies.

Initial Consultation

Anuj Varma – who has written posts on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.