我的任务是在大约8年前用VB.NET / ASP.NET编写的遗留网站添加Web处理程序,使用.NET framework 1.1.4322。
我不明白为什么我收到此错误消息:
Compiler Error Message: BC30154: 'Foo' must implement 'Overridable ReadOnly Property IsReusable() as Boolean' for interface 'System.Web.IHttpHandler'. Implementing property must have matching 'ReadOnly/WriteOnly' specifiers
这是我的代码:
<%@ WebHandler language="VB" class="Foo" %>
Imports System
Imports System.Web
Public Class Foo
Implements IHttpHandler
Public Sub ProcessRequest(context as HttpContext)
Implements IHttpHandler.ProcessRequest
'TO DO: Write request handling code here
End Sub
Public ReadOnly Property IsReusable() as Boolean
Implements IHttpHandler.IsReusable
Get
Return False
End Get
End Property
End Class
我也试过ReadOnly Overrides Property IsReusable()
。
答案 0 :(得分:0)
您需要将IsReusable
属性标记为Overridable
而不是Overrides
。