Publishing WCF Web Service on IIS

Today, I will show you how to to publish WCF Web Service on IIS. I assume your have a working version of your WCF on IIS Express and you want to "publish" it.

Step 1 - Install IIS

Go to: Control Panel Programs and Features Turn Windows Features On and Off

windows_features_link

There are 4 things which need to be installed:

  • Internet Information Services
  • Internet Information Services Hostable Web Core
  • Windows Communication Foundation HTTP Activation
  • Windows Communication Foundation Non-HTTP Activation

Install_IIS_Addon

It would be advisable to restart the computer at this point. In order to ensure that it is properly configured do the following:

Start All Programs Visual Studio (2013) Visual Studio Tools Command Prompt

In the command prompt: run the following:

This command will ensure that ASP.NET is properly installed.

This will ensure that the WCF is installed

Step 2: Adding Application

You probably want to change the setting from .NET 2.0 to 4.0 for default application:
Go to: Control Panel Administration Tools Internet Information Services (IIS) Manager

Editing Application Pool

Double click on the "DefaultAppPool" and change from .NET 2.0 to .NET 4.0.

Default App Pool 4.0

Step 3: Adding new Site

Create the new site.

1. Name of your site
2. Ensure that you are using an application that is of type .NET 4.0 (or what ever the version you want)
3. Specify the path (this is where you will publish the site)
4. Make sure that you are using a different port than 80 (unless you don't have the default site)

Adding New site

Step 4: Publishing Project

Make sure you are running VS with Admin rights

VS doesn't allow you to publish the entire solution so you have to publish project by project. If you have one project than that's easy.

  1. Right-click on the project and select Publish.
  2. Select Web Deploy
  3. server: localhost
    Name: Solution Name/Project (I think you can give anything you want)
    destination: server:port e.g. localhost:81

DONE!