CReplicationServer.Continue Method

For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.

Starts the Commerce Server Staging (CSS) service on the server after the server has been paused.

void Continue()

Remarks

You must have CSS administrator or operator permissions to call this method.

Use the Pause and the Continue methods on the CReplicationServer object to pause and continue the CSS service. After pausing the CSS service, wait five minutes before continuing the service to make sure that the CSS service is in the paused state.

The CReplicationServer.Continue method corresponds to the COM method named ReplicationServer.Continue.

Example

The following example pauses the CSS service that is running on the server, and then restarts it.

#using System.ServiceProcess; // Defined in assembly System.Serviceprocess.dll
// Initialize a service controller to get information on the state of the CSS service
ServiceController ctrl = new ServiceController("Commerce Server Staging");
CReplicationServer replicationServer = new CReplicationServer();
  replicationServer.Initialize("");
// pause service
replicationServer.Pause();
// Wait for the CSS service to pause [wait a maximum of 5 minutes] 
ctrl.WaitForStatus(ServiceControllerStatus.Paused, new TimeSpan(0, 5, 0));
// check if the CSS service is paused.
if(ctrl.Status != ServiceControllerStatus.Paused)
       Console.WriteLine("Service took too long to pause.");
else
  {
    // ...
    replicationServer.Continue();
  }

Compiling the Code

You must add a using directive for the System.ServiceProcesses namespace to run this sample.

See Also

Other Resources

Managing the CSS Service

How to Pause, Continue, Start, and Stop the CSS Service

CReplicationServer.Pause Method

CReplicationServer Class