M
mark.irwin
Need help.
I create a vb file in my app_code folder. Here is the code:
Imports Microsoft.VisualBasic
Imports System.Net.Mail
Public Class email_error
Public Function Send_Error(ByVal str_Page As String, ByVal str_Message
As String, _
ByVal str_SQL As String, ByVal str_StackTrace As String, _
ByVal str_ExString As String) As String
Dim str_Error As String = ""
Dim str_eMail As String = "XXXXXXXXX"
Dim mail As New MailMessage(str_eMail, str_eMail)
mail.IsBodyHtml = True
mail.Subject = "Outside Web Error " & str_Page
str_Error = "<b>Page:</b><br>" & str_Page & "<br><br>" _
& "<b>Message:</b><br>" & str_Message & "<br><br>" _
& "<b>SQL String:</b><br>" & str_SQL & "<br><br>" _
& "<b>Everything:</b><br>" & str_ExString & "<br><br>" _
& "<br><b>StackTrace:</b>:<br>" & str_StackTrace
mail.Body = str_Error
Dim instance As New SmtpClient("XXXXXX")
instance.Send(mail)
Return str_Error
End Function
End Class
Then I call this code like this:
Dim myEmail As New email_error
myEmail.Send_Error(Request.ServerVariables("Path_Info"), ex.Message,
strSQL, ex.StackTrace.ToString, ex.ToString)
All of this works just fine UNLESS the folder that the file with this
code is an application in IIS. If I remove the application it works
but everything else starts blowing up.
The error I get when I have the application created is this:
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: BC30002: Type 'email_error' is not defined.
With this line highlighted:
Dim myEmail As New email_error
Does anyone have any ideas?
Thanks in advance.
I create a vb file in my app_code folder. Here is the code:
Imports Microsoft.VisualBasic
Imports System.Net.Mail
Public Class email_error
Public Function Send_Error(ByVal str_Page As String, ByVal str_Message
As String, _
ByVal str_SQL As String, ByVal str_StackTrace As String, _
ByVal str_ExString As String) As String
Dim str_Error As String = ""
Dim str_eMail As String = "XXXXXXXXX"
Dim mail As New MailMessage(str_eMail, str_eMail)
mail.IsBodyHtml = True
mail.Subject = "Outside Web Error " & str_Page
str_Error = "<b>Page:</b><br>" & str_Page & "<br><br>" _
& "<b>Message:</b><br>" & str_Message & "<br><br>" _
& "<b>SQL String:</b><br>" & str_SQL & "<br><br>" _
& "<b>Everything:</b><br>" & str_ExString & "<br><br>" _
& "<br><b>StackTrace:</b>:<br>" & str_StackTrace
mail.Body = str_Error
Dim instance As New SmtpClient("XXXXXX")
instance.Send(mail)
Return str_Error
End Function
End Class
Then I call this code like this:
Dim myEmail As New email_error
myEmail.Send_Error(Request.ServerVariables("Path_Info"), ex.Message,
strSQL, ex.StackTrace.ToString, ex.ToString)
All of this works just fine UNLESS the folder that the file with this
code is an application in IIS. If I remove the application it works
but everything else starts blowing up.
The error I get when I have the application created is this:
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: BC30002: Type 'email_error' is not defined.
With this line highlighted:
Dim myEmail As New email_error
Does anyone have any ideas?
Thanks in advance.