0

I'm building a WCF WindowsService in .NET 4.0. I'd like to make it RESTfull and change the response and request type to JSON. To do that I need to use the WebGetAttribute under the OperationContract in the interface. But I can't find the System.ServiceModel.Web assembly (which is supposed to be in a System.ServiceModel.Web.dll according to MSDN). There's no trace of that DLL in the Add Reference form and if I try "using System.ServiceModel.Web;", it's not working either.

Do you have any idea what my problem is ?

Will Hartung
  • 115,893
  • 19
  • 128
  • 203
Patrice Cote
  • 3,572
  • 12
  • 43
  • 72
  • I found the DLL, it was in the 3.5 version of the Framework (sine I also have VS 2008 installed on this machine)... But there is no trace of it in the AddReference form as I mentioned – Patrice Cote Feb 18 '12 at 23:35

2 Answers2

1

Well, turned out I was targeting ".NET Framework 4 Client Profile" which doesn't exposes all the DLLs. Thanks to this post. Changed it to ".NET Framework 4" and everything's OK.

Community
  • 1
  • 1
Patrice Cote
  • 3,572
  • 12
  • 43
  • 72
1

Starting with .NET Framework 4, you should no longer need to reference System.ServiceModel.Web.dll at all. The article is outdated, as starting with .NET Framework 4, all classes in System.ServiceModel.Web.dll simply forward to classes in System.Runtime.Serialization.dll and System.ServiceModel.dll.

So, my point is -- as long as you're NOT using the Client Profile of the .NET Framework -- just refer to System.Runtime.Serialization.dll and System.ServiceModel.dll, and you should be set.

krisragh MSFT
  • 1,908
  • 1
  • 13
  • 22