This documentation is archived and is not being maintained.

Project Object

Visual Studio .NET 2003

Represents a project in the integrated development environment (IDE).




[Visual Basic .NET]
Public Interface Project
    Inherits IDispatch
[Visual Basic 6]
Class Project
interface Project : IDispatch
public interface Project : IDispatch
[JScript .NET]
public interface Project extends IDispatch


Every project in the solution has a project automation interface. In rare cases, this is a generic unmodeled project implementation that returns the project's name.

Every tool in the environment that has a project has a Project object.

Reference this object using DTE.Solution.Item, or using a specific language's objects, such as DTE.VBProjects.Item, or DTE.VCProjects.Item.


Namespace: EnvDTE

File: dte.tlb


Sub ProjectExample()
   'This function creates a solution and adds a Visual Basic .NET Console
   'project to it. 
   Dim soln As Solution
   Dim proj As Project
   Dim msg As String

   'Create a reference to the solution.
   soln = DTE.Solution

   ' Create a new solution.
   soln.Create("c:\temp2", "MyNewSolution")

   ' Create a new VB Console application project. Adjust the save path as 
   proj = soln.AddFromTemplate("C:\Program Files\Microsoft Visual Studio .NET\Vb7\VBWizards\ConsoleApplication\Templates\1033\ConsoleApplication.vbproj", "c:\temp2", "My New Project", True)
   ' Save the new solution and project.
   msg = "Created new solution: " & soln.FullName & vbCrLf
   msg = msg & "Created new project: " & proj.Name
End Sub

See Also

ProjectItem Object | Projects Collection

Properties, Methods, and Events