I think that the only way you can get the line number is to upload the pdb
file with your apps dll file. If you are using the release dll, you must
add pdb creation to your project settings. But if you do upload the pdb
file, make sure that you are handling all errors yourself (I don't think the
customerrors section is what you are looking for since an error just causes
a redirect to the error page and the stack is lost. What you should look
into is the Global.asax file at ApplicationError() or Page.Error to handle
errors. Again, you must include the pdb file from what I know. Here are
some examples:
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
Dim ex As Exception = Server.GetLastError()
If TypeOf ex Is SqlClient.SqlException Then
If CType(ex, SqlClient.SqlException).Number = 17 Then
Server.ClearError()
ErrorReport.RedirectToError(ErrorReport.ErrorCodes .DatabaseMaintenance)
End If
Else
If UseGlobalErrorHandler Then
Dim errorText As String = CreateExceptionString(ex)
SendCriticalErrorEmail(errorText)
HttpContext.Current.Trace.Warn("An error occured",
errorText)
Server.ClearError()
ErrorReport.RedirectToError(ErrorReport.ErrorCodes .Unknown)
End If
End If
End Sub
Public Shared Function CreateExceptionString(ByVal ex As Exception) As
String
Dim text As New System.Text.StringBuilder("")
Dim NL As String = System.Environment.NewLine
If Not TypeOf ex Is System.Web.HttpUnhandledException Then
text.Append("An error has occured." + NL)
text.AppendFormat("Time: {0}{1}", Now.ToString, NL)
text.AppendFormat("Request type: {0}{1}",
HttpContext.Current.Request.HttpMethod, NL)
text.AppendFormat("Url: {0}{1}",
HttpContext.Current.Request.Url.ToString, NL)
text.AppendFormat("Referrer: {0}{1}",
HttpContext.Current.Request.UrlReferrer, NL)
text.AppendFormat("Current username: {0}{1}",
Security.GetCurrentUsername, NL)
text.AppendFormat("Current user ID: {0}{1}",
Security.GetCurrentUserID, NL)
text.AppendFormat("Current user type: {0}{1}",
Security.GetCurrentUserType, NL)
text.AppendFormat("Source: {0}{1}", ex.Source, NL)
text.AppendFormat("Message: {0}{1}", ex.Message, NL)
text.AppendFormat("Stack trace: {0}{1}", ex.StackTrace, NL)
End If
If Not IsNothing(ex.InnerException) Then
text.AppendFormat("=============================== ====={0}{1}",
NL, CreateExceptionString(ex.InnerException))
End If
Return text.ToString
End Function
"Yongsub Eric Shin" <ya***@yaric.com> wrote in message
news:0c****************************@phx.gbl...
Hi. I'm just a beginner in ASP.Net.
I started writing codes and I keep on getting this Runtime
Error page, where it says
"Description: An application error occurred on the server.
The current custom error settings for this application
prevent the details of the application error from being
viewed remotely (for security reasons). It could, however,
be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error
message to be viewable on remote machines, please create a
<customErrors> tag within a "web.config" configuration
file located in the root directory of the current web
application. This <customErrors> tag should then have
its "mode" attribute set to "Off"."
Where can i find the lines of the error???