Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vb.net error using interface

I am getting this error

"Error 19 Class 'LegacyRouteHandler' must implement 'Function GetHttpHandler(requestContext As RequestContext) As IHttpHandler' for interface 'System.Web.Routing.IRouteHandler'."

from this code:

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

I am clearly implementing GetHttpHandler , any ideas why I am getting this error?

like image 370
Scott Selby Avatar asked Jan 18 '13 18:01

Scott Selby


1 Answers

You need to add an Implements clause after the function prototype.

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

VB.NET doesn't automatically wire up functions to their interface definitions like C# does.

like image 123
Adam Maras Avatar answered Sep 28 '22 16:09

Adam Maras