|
|
|
Bubbling Up An Unhandled Exception From Assembly to Windows Service Causes Service Stop With No Logging
This one was very tricky to track down. We have a windows service that uses an assembly to transcode video files and upload them to a CDN. All of the logging of course takes place in the windows service. In our component the constructors of both the transcode and upload classes take a file full path as a parameter. We do a File.Exists() and if the file does not exist we throw an exception. Normally this is ideal as if an valid object cannot be created with the state given we want to know about it sooner rather than later. In our windows service we instantiate and perform the work of the upload or transcode objects within a for loop that has a try catch. In a non windows service the exception bubbled up will happily be caught and the iteration continues. However, it appears in a windows service it simply stops the iteration at that point. The service is not stopped in the Administrative Tools > Services MMC applet, nor is any information logged to the event viewer.
Posted in:
General on Tuesday, November 03, 2009 3:54 PM by Scott Schecter
Only registered users may post comments.