![]() |
||||
|
Introduction Projects in Visual Studio have three names:
The unique name of a project identifies it unambiguously. This article explains how to get the EnvDTE.Project object given its project unique name. More Information Given a project unique name, for example the Project parameter of the OnBuildProjConfigBegin event of the EnvDTE.BuildEvents class: Public Event OnBuildProjConfigBegin(ByVal Project As String, ByVal ProjectConfig As String, ByVal Platform As String, ByVal SolutionConfig As String) sometimes you need to get the EnvDTE.Project object that is being built. You can't use the EnvDTE.Solution.Projects collection to locate the EnvDTE.Project, since that collection only lists first-level projects, and a project can be nested inside a folder or another project. Although you could locate the EnvDTE.Project object iterating recursively that collection (as described in the article HOWTO: Navigate the files of a solution from a Visual Studio .NET macro or add-in), that approach would be overkill. The extensibility model offers the following method to retrieve the EnvDTE.Project of a project unique name: EnvDTE.Solution.Item(ByVal projectUniqueName As String) As EnvDTE.Project. Go back to the 'Resources for Visual Studio .NET extensibility' section for more articles like this
You can code, design, locate code and document your apps much faster using VB.NET, C#, C++ or Visual J#:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||