共用方式為


GetWinFXPath 工作

GetWinFXPath 工作會傳回目前 Microsoft .NET Framework 執行階段的目錄。

工作參數

參數

描述

WinFXPath

選擇性 String 輸出參數。

指定 .NET Framework 執行階段的真實路徑。

WinFXNativePath

必要的 String 參數。

指定原生 .NET Framework 執行階段的路徑。

WinFXWowPath

必要的 String 參數。

指定在 64 位元系統上的 32 位元 Windows on Windows 模組中,Microsoft .NET Framework 組件的路徑。

備註

如果 GetWinFXPath 工作是在 64 位元處理器上執行,則 WinFXPath 參數設為儲存在 WinFXWowPath 參數中的路徑,否則 WinFXPath 參數設為儲存在 WinFXNativePath 參數中的路徑。

範例

下列範例示範如何使用 GetWinFXPath 工作偵測 .NET Framework 執行階段的原生路徑。

<Project xmlns="https://schemas.microsoft.com/developer/msbuild/2003">
  <UsingTask 
    TaskName="Microsoft.Build.Tasks.Windows.GetWinFXPath" 
    AssemblyFile="C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\PresentationBuildTasks.dll" />
  <Target Name="GetWinFXPathTask">
    <GetWinFXPath
      WinFXNativePath="c:\WinFXNative" 
      WinFXWowPath="c:\WinFXWowNative" />
  </Target>
  <Import Project="$(MSBuildBinPath)\Microsoft.WinFX.targets" />
</Project>

請參閱

概念

建置 WPF 應用程式 (WPF)

其他資源

WPF MSBuild 參考

WPF MSBuild 工作參考

MSBuild 參考

MSBuild 工作參考