Question : Application works only in DEBUG mode

I have an a CMS application internally that has a publish feature which basically retrieves XML formatted data from DB and saves as individual files on the file system.  It has been working fine on my dev and prod boxes and all of a sudden it is not working intermittently on the prod server which is a Windows server 2003 with IIS v6.0. It works perfectly fine on my dev box. On prod box, it throws the error after saving about 2/3rds of the files and calls it quit.

Other than saving files from the DB returned data, it also copies files from one location to another on the web server. Have tried debug code on the server, jumping up Execution Timeout in web.config, also raising Idle Timeout in IIS and nothing seem to work.

I was able to reproduce this on my dev box by creating IIS site for this instead of running from VS. The only time it works with IIS is if I attach the worker process to debug.

Even when runin VS, it fails with Release mode. Only Debug mode works.

Any help is greatly appreciated.
Thanks.
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
Process information: 
    Process ID: 5952 
    Process name: w3wp.exe 
    Account name: NT AUTHORITY\NETWORK SERVICE 
 
Exception information: 
    Exception type: ThreadAbortException 
    Exception message: Thread was being aborted. 
 
    Is authenticated: True 
    Authentication Type: Forms 
    Thread account name: NT AUTHORITY\NETWORK SERVICE 
 
Thread information: 
    Thread ID: 9 
    Thread account name: NT AUTHORITY\NETWORK SERVICE 
    Is impersonating: False 
    Stack trace:    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
   at System.Web.HttpApplication.ApplicationStepManager.ResumeSteps(Exception error)
   at System.Web.HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
   at System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)

Answer : Application works only in DEBUG mode

http://forums.iis.net/t/1121400.aspx
See the bottom post by LethargicGeek.  I think this is your problem ... with a solution.
Random Solutions  
 
programming4us programming4us