IDeploymentStep.Execute(IDeploymentContext) Method

Definition

Executes the deployment step.

public:
 void Execute(Microsoft::VisualStudio::SharePoint::Deployment::IDeploymentContext ^ context);
public void Execute (Microsoft.VisualStudio.SharePoint.Deployment.IDeploymentContext context);
abstract member Execute : Microsoft.VisualStudio.SharePoint.Deployment.IDeploymentContext -> unit
Public Sub Execute (context As IDeploymentContext)

Parameters

context
IDeploymentContext

An object that provides information you can use to determine the context in which the deployment step is executing.

Remarks

Implement your deployment step logic in this method.

This method is executed from the UI thread when a SharePoint project is retracted by using the Retract option on the Build menu in Visual Studio. This method is executed from a background thread in the following cases:

  • When a project is automatically retracted after debugging. This occurs when the Auto-retract after debugging property on the SharePoint tab of the project properties is selected.

  • When a project is deployed.

Some APIs in the Visual Studio object model might not work as expected from a background thread. If you need to call one of these APIs from the Execute method, you can marshal the call to the UI thread by using a SynchronizationContext object. In your implementation of the Initialize method, use the Current property to get the SynchronizationContext of the UI thread. Then, in your implementation of the Execute method, use the Post or Send methods of the SynchronizationContext object to marshal the call to the UI thread.

Applies to