当前位置 : 主页 > 编程语言 > c语言 >

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

来源:互联网 收集:自由互联 发布时间:2021-06-24
我收到了这个错误 “Error 19 Class ‘LegacyRouteHandler’ must implement ‘Function GetHttpHandler(requestContext As RequestContext) As IHttpHandler’ for interface ‘System.Web.Routing.IRouteHandler’.” 从这段代码: P
我收到了这个错误

“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#.

网友评论