简体   繁体   中英

XAML Build InvokeProcess build variables

I am currently doing an invoke process from my custom XAML build definition to run VSTest.Console.exe with some parameters. I have hard coded the path to the Visual Studio folder in the FileName property. I would like to use the $(VSINSTALLDIR) variable instead of hard coding the C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\ portion of the path since I believe that the $(VSINSTALLDIR) points to the latest (or perhaps last?) installed version of Visual Studio.

Below is my current InvokeProcess XAML directive:

<mtbwa:InvokeProcess Arguments="[msTestParamsBuilder.ToString()]" DisplayName="Invoke VSTest.Console for Test Assemblies" FileName="C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\VSTest.Console.exe" sap2010:WorkflowViewState.IdRef="InvokeProcess_4" WorkingDirectory="[BuildDirectory]">

$(VSINSTALLDIR) is not the environment variables in TFS. TFS build does not apply the value of $(VSInstallDir) macros ( C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\ ) Detail info about the environment variables in TFS build please refer this link: Team Foundation Build environment variables

In your case, you need to add the value in XAML build config:

Process->Build->5. Advances->MSBuild arguments add /p:VSInstallDir = Value

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM