共用方式為


IDeploymentContext Interface

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

Represents the context of a deployment step that is being executed while a SharePoint project is being deployed or retracted.

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

Syntax

'Declaration
Public Interface IDeploymentContext _
    Inherits IAnnotatedObject
public interface IDeploymentContext : IAnnotatedObject

The IDeploymentContext type exposes the following members.

Properties

  Name Description
Public property Annotations Gets an instance IAnnotationDictionary to associate custom data with the object implementing the IAnnotatedObject interface. (Inherited from IAnnotatedObject.)
Public property IsCanceled Gets whether the deployment was canceled by the user.
Public property IsDeploying Gets whether the project is being deployed.
Public property IsRetracting Gets whether the project is being retracted.
Public property Logger Gets the access to the project logger.
Public property Project Gets the access to the current project that is being deployed or retracted.
Public property StartMode Gets the access to the start mode the reason why deployment was initiated.

Top

Methods

  Name Description
Public method SiteCollectionUrl Returns the canonical URL of the Microsoft.SharePoint.SPSite that the project is connected to, according to SharePoint.
Public method SiteUrl Returns the canonical URL of the Microsoft.SharePoint.SPWeb that the project is connected to, according to SharePoint.
Public method WebApplicationUrl Returns the root URL of the SPWebApplication.

Top

Remarks

Visual Studio passes IDeploymentContext to the CanExecute and Execute methods of deployment steps. A new deployment context is initialized at the start of a deployment and retraction operation.

The IDeploymentContext interface implements the IAnnotatedObject to enable deployment steps to store and pass data between steps.

See Also

Reference

Microsoft.VisualStudio.SharePoint.Deployment Namespace