Share via


IDeploymentStep.Execute Method

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Executes the deployment step.

Namespace:  Microsoft.VisualStudio.SharePoint.Deployment
Assembly:  Microsoft.VisualStudio.SharePoint (in Microsoft.VisualStudio.SharePoint.dll)

Syntax

'Declaration
Sub Execute ( _
    context As IDeploymentContext _
)
void Execute(
    IDeploymentContext context
)

Parameters

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.

.NET Framework Security

See Also

Reference

IDeploymentStep Interface

Microsoft.VisualStudio.SharePoint.Deployment Namespace

Other Resources

Walkthrough: Creating a Custom Deployment Step for SharePoint Projects