Cannot manually run jobs if scheduler disabled

Found in

EPiServer.CMS.Core 10.4.3

Fixed in

EPiServer.CMS.Core 10.6.0

Created

Mar 06, 2017

Updated

Mar 24, 2017

Area

CMS Core

State

Closed, Fixed and tested


Description

Steps to reproduce

1. In an Alloy demo site, disable the scheduler by adding the scheduler=false attribute to applicationSettings:

<applicationSettings enableScheduler="false" ...> 

2. Add a new class to the project. Be sure to give it a unique name:

using EPiServer.PlugIn; 
using EPiServer.Scheduler;
 
namespace AlloyDemo.Business 
{ 
        [ScheduledPlugIn(DisplayName = "Job title", Description = "Job description", SortIndex = 100)] 
        public class SomeJob : ScheduledJobBase 
        { 
                // ... 
                public override string Execute() 
                { 
                        return "Done"; 
                } 
        } 
}

3. Compile and start the website.
4. Go to the admin UI and select the new job.

It's very important that the scheduler is off before the job is added, and that a job with the same name/namespace doesn't already exist in tblScheduledItem.