{"action":"created","issue":{"url":"https://api.github.com/repos/tynor88/Topshelf.SimpleInjector/issues/1","labels_url":"https://api.github.com/repos/tynor88/Topshelf.SimpleInjector/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/tynor88/Topshelf.SimpleInjector/issues/1/comments","events_url":"https://api.github.com/repos/tynor88/Topshelf.SimpleInjector/issues/1/events","html_url":"https://github.com/tynor88/Topshelf.SimpleInjector/issues/1","id":41739765,"number":1,"title":"UseQuartzSimpleInjector interfears with Topshelf install and uninstall","user":{"login":"gbanister","id":63455,"avatar_url":"https://avatars.githubusercontent.com/u/63455?v=3","gravatar_id":"","url":"https://api.github.com/users/gbanister","html_url":"https://github.com/gbanister","followers_url":"https://api.github.com/users/gbanister/followers","following_url":"https://api.github.com/users/gbanister/following{/other_user}","gists_url":"https://api.github.com/users/gbanister/gists{/gist_id}","starred_url":"https://api.github.com/users/gbanister/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gbanister/subscriptions","organizations_url":"https://api.github.com/users/gbanister/orgs","repos_url":"https://api.github.com/users/gbanister/repos","events_url":"https://api.github.com/users/gbanister/events{/privacy}","received_events_url":"https://api.github.com/users/gbanister/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/tynor88/Topshelf.SimpleInjector/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2014-09-02T18:31:23Z","updated_at":"2015-12-16T14:40:16Z","closed_at":"2015-04-25T19:51:26Z","body":"If you use  config.UseQuartzSimpleInjector(_container); as is done in the QuartzAsService.Sample,  the TopShelf install and uninstall operations succeed however they do not complete, causing he user to have to end the process by using ctrl+c.  This becomes an issue for spripted/automated deployments.  In order to work around this behavior the following line must be executed durring an install or uninstall.\r\nScheduleJobServiceConfiguratorExtensions.SchedulerFactory().Shutdown();\r\n\r\nI suspect the root of this issue is related to the creation of the scheduler via the call schedulerFactory.GetScheduler()  in the SetupQuartzSimpleInjector() method.  Perhaps this method could determine if a TopShelf install or uninstall operation is being executed and if so then exit the SetupQuartzSimpleInjector without calling schedulerFactory.GetScheduler()."},"comment":{"url":"https://api.github.com/repos/tynor88/Topshelf.SimpleInjector/issues/comments/165128525","html_url":"https://github.com/tynor88/Topshelf.SimpleInjector/issues/1#issuecomment-165128525","issue_url":"https://api.github.com/repos/tynor88/Topshelf.SimpleInjector/issues/1","id":165128525,"user":{"login":"vadimshaporov","id":8492981,"avatar_url":"https://avatars.githubusercontent.com/u/8492981?v=3","gravatar_id":"","url":"https://api.github.com/users/vadimshaporov","html_url":"https://github.com/vadimshaporov","followers_url":"https://api.github.com/users/vadimshaporov/followers","following_url":"https://api.github.com/users/vadimshaporov/following{/other_user}","gists_url":"https://api.github.com/users/vadimshaporov/gists{/gist_id}","starred_url":"https://api.github.com/users/vadimshaporov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vadimshaporov/subscriptions","organizations_url":"https://api.github.com/users/vadimshaporov/orgs","repos_url":"https://api.github.com/users/vadimshaporov/repos","events_url":"https://api.github.com/users/vadimshaporov/events{/privacy}","received_events_url":"https://api.github.com/users/vadimshaporov/received_events","type":"User","site_admin":false},"created_at":"2015-12-16T14:40:16Z","updated_at":"2015-12-16T14:40:16Z","body":"I might have faced something similar. When using Topshelf+Quartz+SimpleInjector and adding listener to the job, everything works fine (services injected to the job as expected), but when I execute install, I get the error saying that IScheduler was not registered in the container. \r\nI tried registering it this way: \r\nvar schedulerFactory = new StdSchedulerFactory();\r\nContainer.Register<IScheduler>(() => schedulerFactory.GetScheduler());\r\ninstall worked, but as gbanister mentioned, I have to do ctrl+c to complete install and uninstall. When running application by F5, it crashes saying IScheduler is already registered.\r\nEverything works fine if I don't add listener to the job."}}