我收到了这个错误 “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#.