Hi Robert,
As for such hang behavior problem, generally, if we can not get clear clus
from code logic, it will require some debugging work on it (such as find
the blocking thread and resource).
Not sure whether you've already read some about managed debugging on
application hang, here are some good blog article about managed debugging:
#.NET Debugging Demos Lab 1: Hang
http://blogs.msdn.com/tess/archive/2...mos-lab-1-hang
.aspx
#.NET Hang Debugging Walkthrough
http://blogs.msdn.com/tess/archive/2...ng-walkthrough
.aspx
BTW, as you provided the code snippet and the potential block point, how
did you originally track down to it? Also, it seems there are many method
calls on a custom class, has it accessed any particular resource or objects
that may cause problem?
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: "Microsoft" <Ro*********@nospam.nospam>
Subject: Question on Program Hanging
Date: Tue, 13 May 2008 12:22:45 -0400
>Hi
I have a c# program that continually runs 24/7 and performs a variety of
tasks based on a timer.
There is one routine that hangs every Saturday morning without fail. If I
restart the program throughout the week is still hangs. I can restart it
immediatly after the hang and it runs fine until next Saturday.
There is nothing different about Saturday that I can think of.
Any help tracking this down would be appreciated!
Thanks
Robert
Here is the code snip:
af.AddToFile(Constants.c_LogFile,DateTime.Now.ToS tring() + " Start Grab
New
>Invoices") ; // Simply writes out to a log file
ds = gds.GrabTheData("NewInvoices"); // ar_GetEmailInvoice01 - Puts data
into a dataset
af.AddToFile(Constants.c_LogFile,DateTime.Now.ToS tring() + " End Grab New
Invoices") ;
af.AddToFile(Constants.c_LogFile, DateTime.Now.ToString() + " Start For
each");
af.AddToFile(Constants.c_LogFile, DateTime.Now.ToString() + " Start For
each
>Next");
// ****************************************** HANGS Here or
tempRowCount = ds.Tables[0].Rows.Count;
// ****************************************** HANGS Here
af.AddToFile(Constants.c_LogFile, DateTime.Now.ToString() + " Row Count "
+
>tempRowCount.ToString() ) ;
foreach (DataRow dr in ds.Tables[0].Rows)
{
af.AddToFile(Constants.c_LogFile,DateTime.Now.ToSt ring() + " Email the
Invoice") ;
CreateInvoice(dr["CustNum"].ToString(),dr["OrdNum"].ToString()) ;
EmailInvoice(dr["CustNum"].ToString(),dr["OrdNum"].ToString()) ;
gds.CustNum = dr["CustNum"].ToString() ;
gds.QuoteNum = dr["OrdNum"].ToString() ;
gds.UpdateTheData("InvoicesEmailed") ;
}
af.AddToFile(Constants.c_LogFile,DateTime.Now.ToS tring() + " Exiting") ;