0
votes

I have a build pipeline set up for a UWP project.

tasks

The build solution task has the following YAML

which mentions errors

 #Your build pipeline references an undefined variable named ‘Parameters.solution’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972
    #Your build pipeline references an undefined variable named ‘Parameters.msbuildArgs’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972
    #Your build pipeline references the ‘BuildConfiguration’ variable, which you’ve selected to be settable at queue time. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it settable at queue time. See https://go.microsoft.com/fwlink/?linkid=865971
    steps:
    - task: VSBuild@1
      displayName: 'Build solution **\*.sln'
      inputs:
        solution: '$(Parameters.solution)'

        vsVersion: 15.0

        msbuildArgs: '$(Parameters.msbuildArgs)'

        platform: x86

        configuration: '$(BuildConfiguration)'

I want to set the path to publish for the Publish Artifact task

However when I select the elipse to choose the path to publish I don't see any kind of artifact folder to select. select path

I am having a problem getting the mental model of what is going on on the build server ( the hosted agent ).

When I look at the console output for each task that runs I can see that it is creating folders with the source code in them for example

D:\a\1\s\jtUFlow\jtUFlow\jtUFlow.csproj 

It would help to have an explorer view of the hosted agent with the variables pointing to the folders.

As Ajaxer points out I cant browse the folders in the pipeline because they don't yet exist.

I can see in the console output of the Build solution task code such as

Creating directory "D:\a\1\a\AppxPackages\jtUFlow_1.0.0.0_Test\Add-AppDevPackage.resources".

Is it reasonable to assume that (Build.ArtifactStagingDirectory)\AppxPackages\ is mapping to this?

2

2 Answers

1
votes

All the values for the pre-defined variables like Build.Artifactstagingdirectory,Build.StagingDirectory etc., have a default value which you can find here

As per the above the value of

$(Build.Artifactstagingdirectory) is The local path on the agent where any artifacts are copied to before being pushed to their destination. For example: c:\agent\_work\1\a

From the UI you can only choose the path from your repo. You can't able to view the build.artifactstagingdirectory in UI

1
votes

I suggest that you ignore the YAML errors reported. They do not seem to affect the operation of the task.

The 'Path to publish' can be either a specific value for this field, or you can refer to a parameter or a combination of both. And this field value MUST be the same as in the previous task where the artifacts are created, ie the Build task

The MSBuild property for the location of the files (which becomes the Path to publish location) is specified in the Field named MsBuild Arguments. By default the argument list will include this

/p:AppxPackageDir="$(Build.ArtifactStagingDirectory)\AppxPackages\"

Then in the next task where you publish the artifacts you must refer to this same location. That is, set the value of the field 'Path to publish' to be the same string as you entered in the previous task.

As @Jayendran said, you can't browse to this \AppxPackages folder as it is dynamically created during the pipeline processing. In fact you can't browse to any of the working directory locations as by definition you are editing the pipeline and therefore it is not running so those locations do not exist.