【问题标题】:Attribute 'ScriptServiceAttribute' cannot be applied to 'MethodName' because the attribute is not valid on this declaration type属性“ScriptServiceAttribute”无法应用于“MethodName”,因为该属性在此声明类型上无效
【发布时间】:2018-07-05 07:48:15
【问题描述】:

以下是WebMethod 的定义,但我遇到了错误

<WebMethod()> _
<ScriptService()>
Public Function GetCountryByIP(ipAddress As String) As String
    Return "Hello World"
End Function

错误 132 属性“ScriptServiceAttribute”无法应用于“GetCountryByIP”,因为该属性在此声明类型上无效。

【问题讨论】:

    标签: ajax vb.net webmethod


    【解决方案1】:

    error message 很清楚。

    根据documentationScriptServiceAttribute必须应用于类,不能应用于方法。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-12-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-01-30
      • 1970-01-01
      相关资源
      最近更新 更多