5/14/11

WCF Service Project Properties is missing the WCF Options Tab

If your WCF Library project does not auto start the WCF Service host when trying to start the project in debug mode, the project file has some missing elements. A way to check this is to right click on the project name (Visual Studio) and look for the WCF Options tabs on the left side of the window.  If you do not see the tab, this means that the library project for some reason was not created as a WCF library.   
A quick way to resolve this is to create a new WCF Service Library project and copy all the files over. If you do not want to do this, you can manually modify the project file and add the missing elements as follows:
·         Right click the project name and select Open Folder in Windows explorer
·         Look for your project file which should end with a .csproj extension and open the file with your favorite editor or just notepad.
·         In the first PropertyGroup element do the following:
o   Look for the ProductVersion element. Update the product version to match the following: 
<ProductVersion>8.0.50727</ProductVersion>

o   Below the AssemblyName element, add the following elements:
<ProjectTypeGuids>{3D9AD99F-2412-4246-B90B-4EAA41C64699};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<StartArguments>/client:"WcfTestClient.exe"</StartArguments>

o   Scroll to the end of the file, and below the Import  element add the following extension:
<ProjectExtensions>
    <VisualStudio>
      <FlavorProperties GUID="{3D9AD99F-2412-4246-B90B-4EAA41C64699}">
        <WcfProjectProperties>
          <AutoStart>True</AutoStart>
        </WcfProjectProperties>
      </FlavorProperties>
    </VisualStudio>
  </ProjectExtensions>

o   Save the file and select yes when Visual Studio prompts to reload the project.
The changes update the project type from a basic library project to a WCF Service library. You can now do project properties and should see the WCF Options tab. The Start WCF service host option should be checked. You can now run the project in debug mode, and the WCF Service Host should start.
I hope this save you some time and thanks for reading.

og-bit.com