共用方式為


VsShellUtilities.GetHierarchy Method

Gets the hierarchy node that is specified by the project GUID.

Namespace:  Microsoft.VisualStudio.Shell
Assembly:  Microsoft.VisualStudio.Shell.11.0 (in Microsoft.VisualStudio.Shell.11.0.dll)

Syntax

'宣告
Public Shared Function GetHierarchy ( _
    site As IServiceProvider, _
    projectGuid As Guid _
) As IVsHierarchy
public static IVsHierarchy GetHierarchy(
    IServiceProvider site,
    Guid projectGuid
)

Parameters

  • projectGuid
    Type: System.Guid
    The GUID of the project.

Return Value

Type: Microsoft.VisualStudio.Shell.Interop.IVsHierarchy
The IVsHierarchy interface of the project.

Remarks

If the project is not open, this method will catch and trace an InvalidCastException.

.NET Framework Security

See Also

Reference

VsShellUtilities Class

Microsoft.VisualStudio.Shell Namespace