使用自定义类时出现编译错误
环境:VS2010
语言:VB.NET
现象:创建了一个类文件MyClass.vb存放在APP_Code文件夹中,其中含有一个类ClassWX,以及若干方法与函数。调用页面中使用妱下语句创建对象及调用:
Dim wx As New ClassWX
wx.SendMessage("123456", "TEST")
在本地调试运行时,可以正常执行;上传到服务器以后打开页面就出错:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30506: Handles clause requires a WithEvents variable defined in the containing type or one of its base types.
Source Error:
Line 253: End Function
Line 254:
Line 255: Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Line 256: Dim wx As New ClassWX
Line 257: wx.SendMessage("123456", "TEST")
烦请大家给予解答,先谢了!