Wrox Programmer Forums
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old January 9th, 2007, 07:32 AM
Registered User
Join Date: Jan 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Thread was being aborted


I am trying to Log the exceptions using Logging block in Flat File. For this purpose I have defined configuration in web.config file and below is the code.

I have created a utility function to log exceptions. But I am getting “Thread was being aborted.” Error. Below is the CallsStack:

Extended Properties:
    Callstack= at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
   at System.Environment.get_StackTrace()
   at System.Diagnostics.TraceEventCache.get_Callstack()
   at System.Diagnostics.TraceListener.WriteFooter(Trace EventCache eventCache)
   at System.Diagnostics.TraceListener.TraceData(TraceEv entCache eventCache, String source, TraceEventType eventType, Int32 id, Object data)
   at Microsoft.Practices.EnterpriseLibrary.Logging.Trac eListeners.FormattedTextWriterTraceListener.TraceD ata(TraceEventCache eventCache, String source, TraceEventType eventType, Int32 id, Object data)
   at Microsoft.Practices.EnterpriseLibrary.Logging.Trac eListeners.FlatFileTraceListener.TraceData(TraceEv entCache eventCache, String source, TraceEventType eventType, Int32 id, Object data)
   at Microsoft.Practices.EnterpriseLibrary.Logging.LogS ource.TraceData(TraceEventType eventType, Int32 id, LogEntry logEntry, TraceListenerFilter traceListenerFilter)
   at Microsoft.Practices.EnterpriseLibrary.Logging.LogW riter.ProcessLog(LogEntry log)
   at Microsoft.Practices.EnterpriseLibrary.Logging.LogW riter.Write(LogEntry log)
   at Microsoft.Practices.EnterpriseLibrary.Logging.Logg er.Write(LogEntry log)
   at AppUtilityMethods.LogExceptionEntry(Exception ex) in D:\Personal\CargoXpert\WebUI\App_Code\AppUtilityMe thods.vb:line 12
   at _Default.Page_Load(Object sender, EventArgs e) in D:\Personal\CargoXpert\WebUI\Default.aspx.vb:line 36 at System.Web.UI.Control.OnLoad(EventArgs e)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest()
   at System.Web.UI.Page.ProcessRequestWithNoAssert(Http Context context)
   at System.Web.UI.Page.ProcessRequest(HttpContext context)
   at ASP.default_aspx.ProcessRequest(HttpContext context)
   at System.Web.HttpApplication.CallHandlerExecutionSte p.System.Web.HttpApplication.IExecutionStep.Execut e()
   at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously)
   at System.Web.HttpApplication.ResumeSteps(Exception error)
   at System.Web.HttpApplication.System.Web.IHttpAsyncHa ndler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
   at System.Web.HttpRuntime.ProcessRequestInternal(Http WorkerRequest wr)
   at System.Web.HttpRuntime.ProcessRequestNow(HttpWorke rRequest wr)
   at System.Web.HttpRuntime.ProcessRequestNoDemand(Http WorkerRequest wr)
   at System.Web.HttpRuntime.ProcessRequest(HttpWorkerRe quest wr)
   at Microsoft.VisualStudio.WebHost.Request.Process()
   at Microsoft.VisualStudio.WebHost.Host.ProcessRequest (Connection conn)

Below is the code.

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

      If IsPostBack = True Then


        â€˜ Some Code here

         Catch ex As Exception

            lblError.Text = "<br />Written to Application Event Log"

         End Try

      End If

End Sub

Public Class AppUtilityMethods

   Public Shared Sub LogExceptionEntry(ByVal ex As Exception)

      Dim log As LogEntry = New LogEntry()

      log.EventId = 6001
      log.Message = ex.Message
      log.Severity = Diagnostics.TraceEventType.Error
      log.Priority = 5


   End Sub

End Class

Old January 9th, 2007, 09:34 AM
Wrox Author
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons

Normally this is caused by trying to call response.redirect inside the catch{} blcok although I do not see one here.

What the problem probably is is that you are writing data out to your label control, comment out that line and see what happens.

I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature
Old January 13th, 2007, 02:25 AM
Authorized User
Join Date: Jul 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to abeen

“‘ Some Code here”#12288;is what ?

  Success grows out of struggles to overcome difficulties.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Thread was being aborted acko ASP.NET 1.0 and 1.1 Basics 15 March 26th, 2014 02:52 AM
Thread was being aborted error neptas ASP.NET 2.0 Professional 0 January 8th, 2008 08:00 AM
Message-thread is getting aborted. debjanib ASP.NET 1.0 and 1.1 Professional 1 July 27th, 2006 06:00 PM
Timeout and Thread was being aborted Vishal_7 ASP.NET 1.0 and 1.1 Basics 0 December 13th, 2004 02:08 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.