How to convert your WCF Service Library to WCF Service Application

Hi Folks,

If you have a WCF Service Library Project in VS 2012 and after you wrote some functional code and then you decided to change the project from a WCF Service Library that doesn’t contain web configurations and can’t be hosted in the IIS to a WCF service application that is hosted in IIS, this blog post will tell you how to do it in details.

The WCF service library doesn’t contains the Web Configuration Tab when you open the project configuration (By right click on the project –> Project Properties) and it has only app.config file and not web.config file because it is not suppose to be hosted in the IIS.

To change your WCF service library to WCF Service Application:

1) Right click on the wcf project and click on unload project.
2) After the project is being unloaded, right click on the wcf project and click edit the project configuration file “.csproj”.
3) Look for the following attribute :

 {3D9AD99F-2412-4246-B90B-4EAA41C64699};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}

Change the project type to the following:

{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}

4) Reload the project.
5) Open the project configuration, you will be able to see the web tab to configure the wcf service.
6) Add web.cofig file to your project.
7) Copy any necassary keys from the app.config to the web.config.
8) Rename or delete the app.config file.
9) Make sure that you have correct port and end point configuration in the web.config.
10) Clean and Build your project.


Note:
This works with VS 2012 project templates with Update 2 as well.

Hope this helps.



 

Leave a Reply

Your email address will not be published. Required fields are marked *


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>