GetWinFXPath 任务

GetWinFXPath 任务返回当前 Microsoft .NET Framework 运行时的目录。

任务参数

Parameter

说明

WinFXPath

可选 String 输出参数。

指定 .NET Framework 运行时的实际路径。

WinFXNativePath

必选 String 参数。

指定本机 .NET Framework 运行时的路径。

WinFXWowPath

必选 String 参数。

指定 32 位 Windows 中的 Microsoft .NET Framework 程序集在 64 位系统上 Windows 模块上的路径。

备注

如果在 64 位处理器上执行 GetWinFXPath 任务,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 任务参考