Setting the “Job Description” of a Custom SharePoint Timer Job [SOLVED]

This post has been edited.  See the end of the post for the thrilling conclusion.

I wanted to set the “Job Description” property of a custom SharePoint Timer Job, because it was not appearing on the “Edit Timer Job” screen in SharePoint Central Admin:

"Job Description" is missing.

If you try to set the “Description” property of your timer job in the constructor, you’ll notice that “Description” is a read-only property of the SPJobDefinition class.

As my colleague pointed out, this “Description” property is a virtual property, as noted in the class description on MSDN:

//MSDN definition of SPJobDefinition.Description property
public virtual string Description { get; }

But you cannot simply override it in your timer job class (which is a subclass of SPJobDefinition) as such, because there is no definition for a ‘set’ accessor:

//Override Description property-- doesn't work
public override string Description
{
     get;
     set;
}

Curious, as was I, my colleague disassembled the SharePoint.dll assembly, and what do you know, the ‘get’ accessor is written to return an empty string (hence the inclusion of the ‘virtual’ keyword to encourage overriding the base accessor):

//Disassembled SharePoint.dll SPJobDefinition class
public virtual string Description
{
     get
     {
      return string.Empty;
     }
}

I also tried creating my own CustomDescription property in my class that inherits from SPJobDefinition and overriding the ‘get’ accessor of the base Description property to return the value of CustomDescription:

//Custom Job Description
private string CustomDescription
{
    get;
    set;
}

// Override built-in Description property by returning our custom description in the getter accessor
public override string Description
{
    get
    { return CustomDescription; }
}

Then I set the value of CustomDescription in the constructor (EDIT: do this in ALL THREE constructors!):

//Constructor for custom timer job class that inherits from SPJobDefinition
public MyTimerJob(string jobName, string jobDescription, SPWebApplication webApplication)
     : base(jobName, webApplication, null, SPJobLockType.ContentDatabase)
{
    this.Title = jobName;
    CustomDescription = jobDescription;
}

No dice.

Here’s the link to the MSDN thread where the same question was supposedly answered; I found this thread following the initial publication of this post, and it looks like we both tried the same thing.  We’ll see if I hear back.

I’m not really sure where to go from here.  It looks as though this “Description” property is set for OOB SharePoint timer jobs only, and there’s nothing we can do about it.  Unless, of course, you can set a timer job’s description from stsadm or a PowerShell script…

Turns out you have to set the CustomDescription in ALL THREE constructors.  Why?  Because even though I’m calling my custom constructor to create the timer job, SharePoint actually calls the base constructor.  Attach to the process if you don’t believe me 🙂