In a Sitecore 9.0.2 instance we have version 3.1.1 of the Sitecore Publishing Service setup.

When publishing items via an administrator account, or a custom workflow, the publishing jobs show up in the publishing dashboard as expected.

We have a scheduled task within Sitecore (defined in the config at /configuration/sitecore/scheduling/agent) that updates and publishes items, using the below code.

using (new Sitecore.SecurityModel.SecurityDisabler())
        var directoryItem = m_MasterDB.Items["/sitecore/content/home/directory"];

        if (directoryItem == null)
            throw new NullReferenceException("The directory item does not exist in Sitecore.");

        // Gets all publishing targets, using Sitecore definitions.
        var publishingTargets = PublishManager.GetPublishingTargets(directoryItem.Database);
        foreach (var publishingTarget in publishingTargets)
            var targetDatabaseName = publishingTarget["Target database"];
            if (string.IsNullOrWhiteSpace(targetDatabaseName))

            var targetDatabase = Sitecore.Configuration.Factory.GetDatabase(targetDatabaseName);
            if (targetDatabase == null)

            var publishOptions = new PublishOptions(
                // Publish sub-items.
                Deep = true

            // Perform the actual publish
            var publisher = new Publisher(publishOptions);
            publisher.Options.RootItem = directoryItem;
    catch (Exception ex)
        Sitecore.Diagnostics.Log.Error(ex.Message, ex, this);

This code publishes as expected, and displays in the default Sitecore logs when it's triggered, but doesn't display in the publishing dashboard.

How would we go about getting programmatic publishes to display in the standalone publishing service's dashboard?

2 Answers 2


Sitecore.Publishing.PublishManager is recommended to use with SPS instead of Publisher. It will show also all publishing tasks in the Publishing Dashboard of SPS.


This is the code I use to do an incremental site publish for old school publishing as well as publishing service. Running publishing as below will add an entry to the publishing dashboard.

var publishAgent = new PublishAgent(SourceDb, targetDb, mode.ToString(), Languages);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.