Export (0) Print
Expand All
Expand Minimize

ProjectDirectory Property

Visual Studio .NET 2003

Returns the name of the directory that contains the project file.

[Visual Basic .NET]
Public ReadOnly Property ProjectDirectory() As String
[Visual Basic 6]
Property Get ProjectDirectory() As String
HRESULT __stdcall get_ProjectDirectory(
   /* [out, retval] */ BSTR* retVal
public string ProjectDirectory {get;}
[JScript .NET]
public function get ProjectDirectory() : String


The following sample code uses the ProjectDirectory property in the development environment:

' add reference to Microsoft.VisualStudio.VCProjectEngine
Imports EnvDTE
Imports Microsoft.VisualStudio.VCProjectEngine

Public Module Module1
    Sub Test()
        Dim prj As VCProject
        prj = DTE.Solution.Projects.Item(1).Object
    End Sub
End Module

See Samples for Project Model Extensibility for information on how to compile and run this sample.

See Also

Applies To: VCProject Object

© 2014 Microsoft