System.ServiceModel.Web is missing in Visual Studio 2010 Console Application ?

I was creating a managed host application for WCF Service. Although it was just to write few lines of codes in console application, it took 1 hrs. for me to figure out a strange problem.

I followed steps as below,

1. Created a console application

2. I had to add reference of System.ServiceModel and System.ServiceModel.Web

And to my surprise System.ServiceModel.Web reference was missing,


When I started looking for a solution on missing System.ServiceModel.Web, I found it was designed not have it in console application. Because by default, Console Application targets to .Net Framework 4 client profile and client profile does not have System.ServiceModel.Web dll


So if you want to add System.ServiceModel.Web in console application, essentially you will have to change Target Framewrok of the console application.

To change target framework, right click and select Properties. On the Application tab you will get option to change


After changing target framework you will get System.ServiceModel.Web to add as reference in your console application project.


6 responses to “System.ServiceModel.Web is missing in Visual Studio 2010 Console Application ?”

  1. […] System.ServiceModel.Web is missing in Visual Studio 2010 Console Application ? (Dhananjay Kumar) […]

  2. Hello,
    I created claim aware WCF service and added STS (ADFS2.0) reference to it. Also added WCF service url as trusted relying party in ADFS.
    I am able to browse the WCF service from IIS without issue and its service reference URL is displayed appropriately.
    When I add service reference in a console client application and try receiving message sent by service I receive an exception as below

    System.ServiceModel.Security.MessageSecurityException: An unsecured or incorrectly secured fault was received from the other party . See the inner FaultException for the fault code and detail. —> System.ServiceModel.FaultException: ID3242: The security token could not be authenticated or authorized

    I have tried a lot to resolve the issue but not able to fix this.

    Kindly let me know If any one has experience working on any application of this nature which will help me resolve the issue.

  3. Thanks for saving my time! I was struck – Ruble

  4. thank you sir!

  5. Thanks bro, you rocked 🙂

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a website or blog at