Hi all,
I'm trying to debug a program I have.
I have a windows service that has a timer which goes off to check for
some files and process them. The event called to handle the Elaspsed
event is as such:
private void ProcessFiles( object sender, ElapsedEventArgs e ) {
string[] files;
int x;
timer.Enabled = false;
files = Directory.GetFiles( DeliveryPath, "*.xml" );
for( int i = 0 ; !Environment.HasShutdownStarted && !IsPaused && i <
files.Length ; i += 1 ) {
ProcessFile( files[ i ] );
x = 1;
}
timer.Enabled = true;
}
private void ProcessFile( string fileName ) {
try {
// Do processing
}
catch( Exception e ) {
// Handle error (do some logging)
}
finally {
// Do some cleanup
}
return;
}
The odd thing is that the exception fires in ProcessFile, all the code
for the handler runs as well as the Finally block.. but the debugger
never goes to the return; line and its as if I hit Continue. The timer
doesn't go off anymore, nor does the loop finish processing. The
process continues to run, but nothing more happens.
Any ideas?