Error message in SQL Server 2008 Replication Monitor: "An error occurred while retrieving the publication data"

Applies to: SQL Server 2008 DeveloperSQL Server 2008 EnterpriseSQL Server 2008 R2 Datacenter

Symptoms


Consider the following scenario:
  • You start Microsoft SQL Server 2008 Management Studio.
  • You start Replication Monitor.
  • You expand a publisher and then click a publication.
In this scenario, you may receive an error message that resembles the following:
An error occurred while retrieving the publication data. Unable to case object of type 'System.DBNull' to type 'Microsoft.sqlserver.Replication.PublisherMonitor.

Cause


This issue occurs if you click the publication before the list of publishers is populated.

Workaround


To work around this issue, wait until the list of publishers is fully populated before you click a publication.

More Information


Typically, the issue that is mentioned in the "Symptoms" section occurs when many servers are listed as publishers. The publisher list may also populate slowly if the servers are busy or are on slow network connections.

References


For more information about Replication Monitor, visit the following MSDN website: