11 years ago

WCF Options missing from project options

Recently I had created a class library.  This class library had all the key interfaces and basic implementations of those objects for a project I was working on.  I added a WCF Service Contract interface to my project and was suprised that the project properties didn't have the WCF Options tab.  This was because the project was originally added to the solution as a class library.

This is how I made Visual Studio 2012 add the WCF Options to the project properties.

  1. Open the .csproj file for your class library in your favourite text editor, I love Notepad++.
  2. Find the <AssemblyName> tag in the first PropertyGroup.
  3. Add the following
    <ProjectTypeGuids>
    {3D9AD99F-2412-4246-B90B-4EAA41C64699};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
    </ProjectTypeGuids>
    <StartArguments>/client:"WcfTestClient.exe"
    
    below the AssemblyName tag.
  4. Save the file and re-load in Visual studio.
  5. You should now see the WCF Options tab.

You may be wondering how I came up with these 'magic' GUIDS.  There is various lists of these floating around on the tinterwebs but the best one I found is here.  You will notice the GUIDs we have applied were the WCF and the C# GUIDS.  I tried adding the WCF one only but it didn't work.