Export (0) Print
Expand All
Expand Minimize

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 _
) 
[C++]
HRESULT __stdcall get_VirtualDirectoryName(
   /* [out, retval] */ BSTR* retVal
);
HRESULT __stdcall put_VirtualDirectoryName(
   /* [in] */ BSTR NewValue
);
[C#]
public string VirtualDirectoryName {get; set;}
[JScript .NET]
public function get VirtualDirectoryName() : String
public function set VirtualDirectoryName(
   NewValue : String
)

Remarks

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.

Example

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"
      MsgBox(wdt.VirtualDirectoryName)
   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

Show:
© 2014 Microsoft