共用方式為


VCWebDeploymentTool.RelativePath 屬性

取得或設定當進行部署時,要將主專案輸出複製至的虛擬目錄之相對路徑。

命名空間:  Microsoft.VisualStudio.VCProjectEngine
組件:  Microsoft.VisualStudio.VCProjectEngine (在 Microsoft.VisualStudio.VCProjectEngine.dll 中)

語法

'宣告
Property RelativePath As String
string RelativePath { get; set; }
property String^ RelativePath {
    String^ get ();
    void set (String^ value);
}
abstract RelativePath : string with get, set
function get RelativePath () : String
function set RelativePath (value : String)

屬性值

型別:System.String
當進行部署時,要將主專案輸出複製至的虛擬目錄之相對路徑。

備註

預設情況下,相對路徑是紙匣。

範例

請參閱HOW TO:編譯專案模型擴充性的範例程式碼如需有關如何編譯及執行這個範例資訊。

下列範例會使用RelativePath在整合式的開發環境 (IDE) 中的屬性:

' 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.RelativePath = "relativePathName"
      MsgBox(wdt.RelativePath)
   End Sub
End Module

.NET Framework 安全性

請參閱

參考

VCWebDeploymentTool 介面

Microsoft.VisualStudio.VCProjectEngine 命名空間