Click here to Skip to main content
15,884,473 members
Articles / WCF
Tip/Trick

Getting Unrecognized Attribute Target Framework Exception

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
8 Apr 2014CPOL1 min read 7.2K   18   2   1
Remove the ‘Anonymous Authentication’ exception that occurs at the time of WCF service (3.5 framework) hosting on IIS

Description

In this tip, I will explain how to get rid of the ‘Anonymous Authentication’ exception of WCF service hosting on IIS, that you create in 3.5 framework.

Introduction

Let’s take a real current scenario, I have a web service in a website (.NET Framework 3.5) which is running on the server and I am using that web service in my Windows application. Now I want to replace the web service to WCF service.

To explain this, I will create:

  • A website with a default page
  • A WCF service in it in place of web service

Follow the steps given below to do this.

Step 1: Add a new website named ‘Wcf_Example’ using 3.5 framework.

Image 1

Step 2: Add a WCF Service named ‘MYService.svc’ into it.

Image 2

This will create 3 files:

  • IMYService.cs – Contains Interface of MYService class
  • MYService.cs – Contains MYService class
  • MYService.svc – Contains details required for WCF service to run it successfully like .asmx in web service

    Image 3

Problem

Get the exception when I run the service ‘http://localhost/WCF_Example/MYService.svc'.

Image 4

Solution

Open the control panel and click on ‘Turn Windows features on or off’.

Image 5

Check the ‘Windows Communication Foundation HTTP Activation’ and ‘Windows Communication Foundation Non- HTTP Activation’.

Image 6

Now run the WCF Service ‘http://localhost/WCF_Example/MYService.svc'.

Image 7

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) CyberQ
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
AnswerMy vote of 5 Pin
Christian Amado9-Apr-14 2:19
professionalChristian Amado9-Apr-14 2:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.