加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

使用界面时出现vb.net错误

发布时间:2020-12-17 07:22:38 所属栏目:百科 来源:网络整理
导读:我收到了这个错误 “Error 19 Class ‘LegacyRouteHandler’ must implement ‘Function GetHttpHandler(requestContext As RequestContext) As IHttpHandler’ for interface ‘System.Web.Routing.IRouteHandler’.” 从这段代码: Public Class LegacyRou
我收到了这个错误

“Error 19 Class ‘LegacyRouteHandler’ must implement ‘Function
GetHttpHandler(requestContext As RequestContext) As IHttpHandler’ for
interface ‘System.Web.Routing.IRouteHandler’.”

从这段代码:

Public Class LegacyRouteHandler
    Implements IRouteHandler
    Public Function GetHttpHandler(requestContext As RequestContext) As IHttpHandler
        Return New LegacyHandler(requestContext)
    End Function
End Class

我正在清楚地实现GetHttpHandler,任何想法我为什么会收到此错误?

解决方法

您需要在函数原型之后添加一个Implements子句.

...) As IHttpHandler Implements IRouteHandler.GetHttpHandler
'                    ^

VB.NET不会自动将函数连接到它们的接口定义,如C#.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读