Can't find [WebInvoke] and [WebGet]

Darshana picture Darshana · Mar 21, 2012 · Viewed 17.9k times · Source

I can't find [WebInvoke] and [WebGet]. I have already add System.ServiceModel reference. what is the problem? I use .NET Framwork 4

Answer

carlosfigueira picture carlosfigueira · Mar 21, 2012

You need to add a reference to the System.ServiceModel.Web.dll. Notice that you need to target the full .NET Framework (either 3.5 or 4.0) - if your application is targeting the client profile for those frameworks, this assembly won't be available.