2017-04-03 6 views
1

Ich versuche in meiner XAML-Vorlage als Argument den Namen des aktuellen Builds, also ich als String-Argument setzen: Aber nach der Warteschlange mein Build I habe diesen Fehler:TFS 2017 - Pass als Argument Build-Nummer Format - BuildDetail.BuildNumber

`Exception Message: Could not find a part of the path 'C:\Windows\system32\BuildDetail.BuildNumber'. (type DirectoryNotFoundExceptio`n) 

Vielen Dank!

EDIT, wo ich das Argument setzen wollen:

enter image description here

Und die Build-Nummer Format ($ (BuildDefinitionName) _ $ (Datum: yyyyMMdd) $ (Rev: .r)) : enter image description here

EDIT 2, ich folge dies:TFS 2010 : Use the label name in build number format enter image description here

Und ich stellte fest, dass:

Exception Message: The root element of the build process template found at $/test8/BuildProcessTemplatest8/BuildProcessSourcet8/Templates/CustomTemplatet8.xaml (version C239) is not valid. (The build process failed validation. Details: 
Validation Error: The private implementation of activity '1: DynamicActivity' has the following validation error: Compiler error(s) encountered processing expression "String.Format("$(BuildDefinitionName)_$(Date:yyyyMMdd)_{0}$(Rev:.r)", BuildDetail.SourceGetVersion)". 
'Microsoft.TeamFoundation.Build.Client.BuildDetail' is not accessible in this context because it is 'Friend'. 

Antwort

0

Sie build variables nutzen könnten. Für XAML-Build ist es TF_BUILD-Umgebungsvariablen, weitere Details finden Sie unter thread.

TF_BUILD_BUILDNUMBER The build number of the build. For example: CIBuild_20130613.6.


aktualisieren

Use environment data from a custom build process

If you need to use an environment variable in your custom build process template , you can use the GetEnvironmentVariable activity to get the data. You can get data from any of the WellKnownEnvironmentVariables.

For example, to get the path to the binaries directory, set the Name property of the GetEnvironmentVariable activity to Microsoft.TeamFoundation.Build.Activities.Extensions.WellKnownEnvironmentVariables.BinariesDirectory

+0

Humm habe ich versucht, mit diesem aber es funktioniert nicht, ich meine erste Nachricht bearbeiten. Das Format der Build-Nummer ist dieses für mich: $ (BuildDefinitionName) _ $ (Datum: yyyyMMdd) $ (Rev: .r) – FrankVDB

+0

@FrankVDB Sieht so aus, als könnten Sie direkt das ** BuildDirectory ** -Argument verwenden, schaut sich das ähnlich an Frage: http://stackoverflow.com/questions/16267283/copy-files-from-tfs-to-build-drop-location-using-copy-directory-activity Es gibt keine Verwendung mit Builddetail.buildnumber in Quellort. –

+0

Außerdem, wenn Sie einen benutzerdefinierten Pfad verwenden möchten, könnten Sie etwas wie diese 'Path.Combine (SourcesDirectory," MyFileFolder ")' verwenden, mehr Details werfen Sie einen Blick auf Daves Antwort in diesem: http://StackOverflow.com/ Fragen/24563341/creating-a-build-process-template-was-tut-nichts-aber-kopieren-alle-Dateien-zu-anoth –