Quartz.net Windsor integration inside Windows Service

302 views
Skip to first unread message

digitalbricklayer

unread,
Mar 22, 2012, 9:30:32 AM3/22/12
to castle-pro...@googlegroups.com

I have downloaded the source code of the Quartz.net Windsor integration project and got the sample console app working without any problems. I have created a similar sample Windows service using the same configuration. The sample service fails to start. When the service is started (using net start SimpleSvc) it says the service is not responding to the control function. When the quartz.net windsor integration is removed, the service starts without any errors. The event log isn't very helpful and just says there was a Quartz.SchedulerException.

Has anybody any experience of using Quartz.net Windsor integration inside a Windows Service? Or, how do I go about debugging this because at the moment I'm struggling to figure out exactly what the problem is.

To reproduce unzip the SampleService.zip file in the sample app and add to the solution then build. Run installutil on the service executable "SampleService.exe". Then run "net start SimpleSvc". If you comment out the first two lines in Program.Main the service will start as expected.

SampleService.zip

digitalbricklayer

unread,
Mar 22, 2012, 2:02:10 PM3/22/12
to castle-pro...@googlegroups.com
I've inserted "Debugger.Launch();" command and the start of Main() and have found that the problem is that an expcetion is thrown saying that Quartz_jobs.xml can't be found. Odd, given that that file is definetely there. Must be looking in an odd place for it.


Mauricio Scheffer

unread,
Mar 22, 2012, 6:02:20 PM3/22/12
to castle-pro...@googlegroups.com
It's been quite some time since I last wrote a Windows Service, but now that you mention this I remember having some issues with the service looking for files in c:\Windows\system32 instead of the local bin :  http://haacked.com/archive/2004/06/29/706.aspx (see the comments for a workaround)

--
Mauricio

digitalbricklayer

unread,
Mar 23, 2012, 4:45:25 AM3/23/12
to castle-pro...@googlegroups.com
Thanks Mauricio that's it! Adding System.IO.Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory); to service Main fixed the problem.
 
Reply all
Reply to author
Forward
0 new messages