T
tshad
I have a program I am trying to compile into a dll and am getting a bunch
of: the following errors:
error BC30469: Reference to a non-shared member requires an object
reference.
At first, I thought it was because I had the sub set as shared, but I get
the same error if it take the Shared out.
What is causing these errors?
**************************************************************************
Imports System
Imports System.Web
Imports System.IO
Imports System.Web.UI
Imports System.Web.SessionState
Imports System.Web.Mail
Imports System.Data
Imports System.Data.SqlClient
Imports System.Web.HttpCookie
Imports System.Web.HttpCookieCollection
Imports System.Web.HttpResponse
Imports System.Web.HttpRequest
Imports System.Web.HttpApplication
Imports System.Web.HttpApplicationState
Imports Microsoft.VisualBasic
Namespace MyComponents
Public Class Emails
Shared sub sendTheEmail( )
dim URLPath As String = Left(request.path, InStrRev(request.path, "/") -
1)
Dim objStreamReader as StreamReader
objStreamReader = File.OpenText(MapPath("mail.htm"))
end sub
End Class
End Namespace
**********************************************************************
And got the following errors:
*******************************************************************************************
C:\Inetpub\wwwroot\Development>vbc /t:library emailClassgood.vb
/r:system.web.dl
l /r:system.data.dll /r:system.dll /r:Microsoft.VisualBasic.dll
Microsoft (R) Visual Basic .NET Compiler version 7.10.6001.4
for Microsoft (R) .NET Framework version 1.1.4322.2032
Copyright (C) Microsoft Corporation 1987-2002. All rights reserved.
C:\Inetpub\wwwroot\Development\EmailClassgood.vb(22) : error BC30469:
Reference
to a non-shared member requires an object reference.
dim URLPath As String = Left(request.path, InStrRev(request.path,
"/") -
1)
~~~~~~~
C:\Inetpub\wwwroot\Development\EmailClassgood.vb(22) : error BC30469:
Reference
to a non-shared member requires an object reference.
dim URLPath As String = Left(request.path, InStrRev(request.path,
"/") -
1)
~~~~~~~
C:\Inetpub\wwwroot\Development\EmailClassgood.vb(24) : error BC30469:
Reference
to a non-shared member requires an object reference.
objStreamReader = File.OpenText(MapPath("mail.htm"))
~~~~~~~
******************************************************************************************
Thanks,
Tom
of: the following errors:
error BC30469: Reference to a non-shared member requires an object
reference.
At first, I thought it was because I had the sub set as shared, but I get
the same error if it take the Shared out.
What is causing these errors?
**************************************************************************
Imports System
Imports System.Web
Imports System.IO
Imports System.Web.UI
Imports System.Web.SessionState
Imports System.Web.Mail
Imports System.Data
Imports System.Data.SqlClient
Imports System.Web.HttpCookie
Imports System.Web.HttpCookieCollection
Imports System.Web.HttpResponse
Imports System.Web.HttpRequest
Imports System.Web.HttpApplication
Imports System.Web.HttpApplicationState
Imports Microsoft.VisualBasic
Namespace MyComponents
Public Class Emails
Shared sub sendTheEmail( )
dim URLPath As String = Left(request.path, InStrRev(request.path, "/") -
1)
Dim objStreamReader as StreamReader
objStreamReader = File.OpenText(MapPath("mail.htm"))
end sub
End Class
End Namespace
**********************************************************************
And got the following errors:
*******************************************************************************************
C:\Inetpub\wwwroot\Development>vbc /t:library emailClassgood.vb
/r:system.web.dl
l /r:system.data.dll /r:system.dll /r:Microsoft.VisualBasic.dll
Microsoft (R) Visual Basic .NET Compiler version 7.10.6001.4
for Microsoft (R) .NET Framework version 1.1.4322.2032
Copyright (C) Microsoft Corporation 1987-2002. All rights reserved.
C:\Inetpub\wwwroot\Development\EmailClassgood.vb(22) : error BC30469:
Reference
to a non-shared member requires an object reference.
dim URLPath As String = Left(request.path, InStrRev(request.path,
"/") -
1)
~~~~~~~
C:\Inetpub\wwwroot\Development\EmailClassgood.vb(22) : error BC30469:
Reference
to a non-shared member requires an object reference.
dim URLPath As String = Left(request.path, InStrRev(request.path,
"/") -
1)
~~~~~~~
C:\Inetpub\wwwroot\Development\EmailClassgood.vb(24) : error BC30469:
Reference
to a non-shared member requires an object reference.
objStreamReader = File.OpenText(MapPath("mail.htm"))
~~~~~~~
******************************************************************************************
Thanks,
Tom