Hello People,
Background
I have a Remote Object consumed by an ASP.NET application for sending mails. The remote object is hosted in IIS 5.0 (WIndows 2000 Server (SP4)). Both the remote object and ASP.NET application are in .Net Framework 1.1.
Why Not Web Service instead of Remote object
It is an obvious question which I am not interested in discussing right now since that will eventually deviate from solving the real problem.
What the Remote Object does
The remote object accepts the send mail request and sends mail through a SMTP server. The location of the SMTP server is stoed in a configuration file. Currently I use local SMTP service that comes with IIS.
Configuration
As I said, the remote object is configured in IIS in Windows 2000 Server (SP4). The configured application (remote object) is set with a timeout of 600 secs. I don't know if that has anything to do with remote object applications. Importantly, both the consuming ASP.NET application and the Remote Object application are residing in the same IIS box and inside same web site node. So both share the same port number. Also, the remote object is setup as Server Activated object in SingleCall mode. The channel is HTTP using Binary formatting. The consuming application uses a Interface to create the proxy.
Exception Handling
I use Microsoft Exception Management Application Block (not EntLib) to log all exceptions encountered in the remote object while sending mails. The remote object returns a status of true/false indicating whether the mail was sent or not. Obviously, when an error occurs, it is logged and a status of false is returned to the consuming ASP.NET application.
The Problem
Recently I am bombarded by "Thread was being aborted" exceptions from the remote object. My research on the exceptions is that ThreadAbortException is normal in ASP.NET as it used in application recycling and response termination. But this is posing a real problem since the mails are not being sent when this exception occurs. I dont get any other exception from the remote object other than ThreadAbortException.
Here is one of the logs stamped when the error occurs...
General Information:
Thread was being aborted.
Additonal Information:
appName: <ABC> Mail Send Engine
action: SendMail
message: Error encountered while sending mail (Thread was being aborted.)
data: Company=<XYZ> AccountId=4 MessageId=210918 CallerId=<XYZ>-Graeme.144.137.79.88
traceId: <XYZ>-Graeme.144.137.79.88
companyName: <XYZ>
userId:
ExceptionManager.MachineName: EXTERNAL
ExceptionManager.TimeStamp: 7/04/2006 9:21:55 AM
ExceptionManager.FullName: Microsoft.ApplicationBlocks.ExceptionManagement, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1b66d047f1e5bbe8
ExceptionManager.AppDomainName: /LM/W3SVC/2/Root/SenderEngine-2-127886775576875000
ExceptionManager.ThreadIdentity:
ExceptionManager.WindowsIdentity: EXTERNALRL\ASPNET
Exception Information:
System.Threading.ThreadAbortException: Thread was being aborted.
at <ABC>.Mail.SenderEngine.MailSender.SendMail(MailMessage objMsg, Int32 accountId, Int32 messageId, NameValueCollection settings, String callerId, String company)
at <ABC>.Mail.SenderEngine.MailSender.SendMailById(String company, Int32 mailAccountId, Int32 messageId, String callerId)

ThreadAbortException encountered in .Net Remoted Object hosted in IIS