Export (0) Print
Expand All

VsShellUtilities.GetProject Method

Returns a project for the specified document.

This method is not CLS-compliant.  

Namespace: Microsoft.VisualStudio.Shell
Assembly: Microsoft.VisualStudio.Shell (in microsoft.visualstudio.shell.dll)

public static IVsHierarchy GetProject (
	IServiceProvider site,
	string moniker
public static IVsHierarchy GetProject (
	IServiceProvider site, 
	String moniker
public static function GetProject (
	site : IServiceProvider, 
	moniker : String
) : IVsHierarchy



The IServiceProvider object used to retrieve the IVsSolution object.


The unique identifier of the document in the project system.

Return Value

The IVsHierarchy interface of the project that contains the document.

If the document is a file, moniker can be the file extension rather than the full path to the file (for example, .bmp or .txt). If the document is not a file, moniker is often a URL.

Community Additions

© 2015 Microsoft