Can't find [WebInvoke] and [WebGet]
Asked Answered
I

3

9

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

Irreproachable answered 21/3, 2012 at 4:56 Comment(0)
S
23

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.

Snooker answered 21/3, 2012 at 5:18 Comment(2)
thanx I think it was the problemIrreproachable
Not having any luck with mine - I am trying to convert a Silverlight 4 --> Silverlight 5 under .NET 4.5.2 - I have added the System.ServiceModel.Web.dll , still no luck... thoughts?Galliett
O
2

Need to add the reference System.ServiceModel.Web.dll and import the namespace System.ServiceModel.Web by using below statement using System.ServiceModel.Web; Then it will work.

Overbid answered 14/1, 2015 at 12:46 Comment(1)
This helped me more than the accepted answer, because it mentions the correct using directive. My DLL reference was OK, but i was missing the using directive (my code was copied from a tutorial). I vote this up.Poliard
U
0

When using attributes "Attribute" portion of the class is implied.

WebInvoke - WebInvokeAttribute

WebGet - WebGetAttribute

Unguent answered 21/3, 2012 at 5:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.