This documentation is archived and is not being maintained.

VirtualDirectoryName Property

Visual Studio .NET 2003

The alias of the virtual directory.

[Visual Basic .NET]
Public Property VirtualDirectoryName() As String
[Visual Basic 6]
Property Get VirtualDirectoryName() As String
Property Let VirtualDirectoryName( _
   ByVal NewValue As String _
HRESULT __stdcall get_VirtualDirectoryName(
   /* [out, retval] */ BSTR* retVal
HRESULT __stdcall put_VirtualDirectoryName(
   /* [in] */ BSTR NewValue
public string VirtualDirectoryName {get; set;}
[JScript .NET]
public function get VirtualDirectoryName() : String
public function set VirtualDirectoryName(
   NewValue : String


This virtual directory is created when deployment occurs if it does not already exist. By default, VirtualDirectoryName is set to the same name as the solution by means of the $(SolutionName) macro.


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

' add reference to Microsoft.VisualStudio.VCProjectEngine
Imports EnvDTE

Imports Microsoft.VisualStudio.VCProjectEngine

Public Module Module1
   Sub Main()
      Dim prj As VCProject
      Dim cfgs, tools As IVCCollection
      Dim cfg As VCConfiguration
      Dim wdt As VCWebDeploymentTool
      prj = DTE.Solution.Projects.Item(1).Object
      cfgs = prj.Configurations
      cfg = cfgs.Item(1)
      wdt = cfg.Tools("VCWebDeploymentTool")
      wdt.VirtualDirectoryName = "myVirtualDirectory"
   End Sub
End Module

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

See Also

Applies To: VCWebDeploymentTool Object