473,806 Members | 2,697 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ThreadAbortExce ption when using Trace

Hey guys,

I just got some really weird behavior. I put the following code into the
Application_Sta rt event in Global.asax:

// init some trace listeners
Uri codeBase = new Uri(Assembly.Ge tExecutingAssem bly().CodeBase) ;
string fileName = Path.GetDirecto ryName(codeBase .LocalPath);
fileName = Path.Combine(fi leName, "pmatsiemens_tr ace" +
DateTime.Now.To String("yyyyMMd dHHmmss") + ".log");
TextWriterTrace Listener listener = new TextWriterTrace Listener(fileNa me,
"FileLogger ");
Trace.Listeners .Add(listener);
Trace.AutoFlush = true;
Trace.WriteLine ("Applicatio n started");

When I then run a web application I notice that Application_Sta rt is
executed over and over again. In the output window I see the following error
messages:

Application started
'/LM/W3SVC/1/Root/MyWebApp-34-127730118577453 952': Loaded
'c:\windows\mic rosoft.net\fram ework\v1.1.4322 \temporary asp.net
files\mywebapp\ 2e53becd\66ad82 af\qf3dspm5.dll ', Symbols loaded.
aspnet_wp!libra ry!af4!10/5/2005-10:51:05:: i INFO: Cleaned 0 batch records,
0 policies, 0 sessions, 0 cache entries, 0 snapshots, 0 chunks, 0 running
jobs
Application ended
An unhandled exception of type 'System.Threadi ng.ThreadAbortE xception'
occurred in Unknown Module.
Additional information: Thread was being aborted.
The program '[2760] aspnet_wp.exe:
/LM/W3SVC/1/Root/MyWebApp-34-127730118577453 952' has exited with code 0
(0x0).
The thread '<No Name>' (0x62c) has exited with code 0 (0x0).

Does anybody have a clue why this is happening?

Thanks, Christoph
Nov 19 '05 #1
4 1826
Christopher,

This is only a guess, but normally in .NET when you change the web.config
file and re-save or change a .dll file and re-save the application restarts
to get the new code. Whatever listner triggers the application restart might
be triggered by your code that is writing to the application's directory.
Try saving elswhere. I think that will resolve the issue.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Christoph Wienands" <ch************ ****@siemens.re move.com> wrote in
message news:un******** *****@tk2msftng p13.phx.gbl...
Hey guys,

I just got some really weird behavior. I put the following code into the
Application_Sta rt event in Global.asax:

// init some trace listeners
Uri codeBase = new Uri(Assembly.Ge tExecutingAssem bly().CodeBase) ;
string fileName = Path.GetDirecto ryName(codeBase .LocalPath);
fileName = Path.Combine(fi leName, "pmatsiemens_tr ace" +
DateTime.Now.To String("yyyyMMd dHHmmss") + ".log");
TextWriterTrace Listener listener = new TextWriterTrace Listener(fileNa me,
"FileLogger ");
Trace.Listeners .Add(listener);
Trace.AutoFlush = true;
Trace.WriteLine ("Applicatio n started");

When I then run a web application I notice that Application_Sta rt is
executed over and over again. In the output window I see the following
error messages:

Application started
'/LM/W3SVC/1/Root/MyWebApp-34-127730118577453 952': Loaded
'c:\windows\mic rosoft.net\fram ework\v1.1.4322 \temporary asp.net
files\mywebapp\ 2e53becd\66ad82 af\qf3dspm5.dll ', Symbols loaded.
aspnet_wp!libra ry!af4!10/5/2005-10:51:05:: i INFO: Cleaned 0 batch
records, 0 policies, 0 sessions, 0 cache entries, 0 snapshots, 0 chunks, 0
running jobs
Application ended
An unhandled exception of type 'System.Threadi ng.ThreadAbortE xception'
occurred in Unknown Module.
Additional information: Thread was being aborted.
The program '[2760] aspnet_wp.exe:
/LM/W3SVC/1/Root/MyWebApp-34-127730118577453 952' has exited with code 0
(0x0).
The thread '<No Name>' (0x62c) has exited with code 0 (0x0).

Does anybody have a clue why this is happening?

Thanks, Christoph

Nov 19 '05 #2
The ThreadAbortExce ption is a bit of a trick ASP.NET uses when a Response.Redire ct
is used.

-Brock
DevelopMentor
http://staff.develop.com/ballen
Hey guys,

I just got some really weird behavior. I put the following code into
the Application_Sta rt event in Global.asax:

// init some trace listeners
Uri codeBase = new Uri(Assembly.Ge tExecutingAssem bly().CodeBase) ;
string fileName = Path.GetDirecto ryName(codeBase .LocalPath);
fileName = Path.Combine(fi leName, "pmatsiemens_tr ace" +
DateTime.Now.To String("yyyyMMd dHHmmss") + ".log");
TextWriterTrace Listener listener = new
TextWriterTrace Listener(fileNa me,
"FileLogger ");
Trace.Listeners .Add(listener);
Trace.AutoFlush = true;
Trace.WriteLine ("Applicatio n started");
When I then run a web application I notice that Application_Sta rt is
executed over and over again. In the output window I see the following
error messages:

Application started
'/LM/W3SVC/1/Root/MyWebApp-34-127730118577453 952': Loaded
'c:\windows\mic rosoft.net\fram ework\v1.1.4322 \temporary asp.net
files\mywebapp\ 2e53becd\66ad82 af\qf3dspm5.dll ', Symbols loaded.
aspnet_wp!libra ry!af4!10/5/2005-10:51:05:: i INFO: Cleaned 0 batch
records,
0 policies, 0 sessions, 0 cache entries, 0 snapshots, 0 chunks, 0
running
jobs
Application ended
An unhandled exception of type 'System.Threadi ng.ThreadAbortE xception'
occurred in Unknown Module.
Additional information: Thread was being aborted.
The program '[2760] aspnet_wp.exe:
/LM/W3SVC/1/Root/MyWebApp-34-127730118577453 952' has exited with code
0
(0x0).
The thread '<No Name>' (0x62c) has exited with code 0 (0x0).
Does anybody have a clue why this is happening?

Thanks, Christoph

Nov 19 '05 #3
> This is only a guess, but normally in .NET when you change the web.config
file and re-save or change a .dll file and re-save the application
restarts to get the new code. Whatever listner triggers the application
restart might be triggered by your code that is writing to the
application's directory. Try saving elswhere. I think that will resolve
the issue.


Goood catch! Should have thought of that myself. Whenever a file changes in
the bin directory the app seems to restart. Now I just save it to a log
directory.

Thanks, Christoph
Nov 19 '05 #4
Christoph,

Lucky guess... YW :-)

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Christoph Wienands" <ch************ ****@siemens.re move.com> wrote in
message news:Ok******** ******@TK2MSFTN GP12.phx.gbl...
This is only a guess, but normally in .NET when you change the web.config
file and re-save or change a .dll file and re-save the application
restarts to get the new code. Whatever listner triggers the application
restart might be triggered by your code that is writing to the
application's directory. Try saving elswhere. I think that will resolve
the issue.


Goood catch! Should have thought of that myself. Whenever a file changes
in the bin directory the app seems to restart. Now I just save it to a log
directory.

Thanks, Christoph

Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1920
by: Mark Phillips | last post by:
Hello, I am having a problem in which a file can get stuck open when a thread that is attempting to write to it gets aborted (ThreadAbortedException occurs). The log file gets stuck open until the process is shut down (cannot delete file from Windows Explorer, for example). My test application stops execution with: An unhandled exception of type 'System.IO.IOException' occurred in mscorlib.dll Additional information: The process...
6
2149
by: David Waz... | last post by:
Moved an app from W/2000 Asp V1.0 to W/2003, VS/2003, ASPV 1.1 Page runs a long job, uploading 2 large fixed length files (300,000 rows) into SQL database. A process is run against the data, and altered flat-files produced. The job aborts at EXACTLY 105 seconds (1 min, 45 seconds) regardless of WHERE in the process we are - could be DB read, DB write, string manipulation - whatever.
0
1337
by: Chee | last post by:
Hi all Please forgive me if this has been asked before. I am getting a ThreadAbortException in "Unknown Module" when i try to load a page from VS.NET. One problem is it does not happen all the time. But with more projects being added to the reference list, I will get it more often. When it happens, I loss information in the Session as it get restarted, and some event doesn't happened (i.e. IndexChanged event in dropdownlist, onclick event...
4
1737
by: splap20 | last post by:
Every day a large chunk of XML is posted up to my app via http. The app interprets this XML and writes results to a SQLServer. Occasionally a ThreadAbortException is thrown during this process. Despite being caught, this exception propagates all the way up the call stack. I know this is by design and that I can use Thread.ResetAbort to stop this exception from bubbling up the stack. But I want to know why the exception is thrown in the...
1
2404
by: Eric | last post by:
I have the following situation: I was getting intermittent errors using Reponse.Redirct("url", true) and was trying to catch the ThreadAbortException, but it was not staying caught and was showing up again where my code wasnt expecting it. I'm not sure what was causing it. The catch block in RedirectPage is supposed to quash the ThreadAbortException but it not only shows up there, but also in the outer catch block will catch it as well....
6
7451
by: foolmelon | last post by:
If a childThread is in the middle of a catch block and handling an exception caught, the main thread calls childThread.Abort(). At that time a ThreadAbortException is thrown in the childThread. The question is: after the ThreadAbortException is thrown, does the childThread continue run the remaining code in the catch block?
3
3353
by: =?Utf-8?B?RXRoYW4gU3RyYXVzcw==?= | last post by:
Hi, I am running a web service which sometimes throws exceptions. I have a lot of error trapping within the web service, but I have missed the current problem. I am working on the current issue, but there even when I get this fixed, there may be others I have not thought of. My immediate problem is that the web service seems to throw a threadabortexception to the client when it has an uncaught exception (I may be wrong. I am a bit confused...
0
1646
by: Zeba | last post by:
Hi ! I am using a httphandler to perform some url rewriting in my application. My web.config contains the following entry to direct all urls containing /App/*.ashx to my class AppHandler.cs in namespace mySite.Web <httpHandlers> <add verb="*" path="App/*.ashx" type="mySite.Web.AppHandler, App_Code"/>
0
1093
by: Morgan Cheng | last post by:
It is recommended that to re-throw Exception in catch block with just "throw;" instead of "throw ex;", because "throw ex;" lose the original Exception's stack trace. ThreadAbortException will be re-thrown automatically even it is not throw explicitly in catch block. However, it seems that is re-thrown with "throw ex", not just "throw". So, the stack trace is lost. I am wondering why .Net recommend people to use "throw" but doesn't use...
0
9598
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10623
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10371
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10111
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7650
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5546
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4330
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3852
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3010
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.