We have one ASP.Net solution with several projects. each project have build.pubxml
with unique folder path.
For example:
In project Test
we have this line inside the build.pubxml
:
<publishUrl>C:\publish\SolutionName\Test</publishUrl>
In project Exam
we have this line inside the build.pubxml
:
<publishUrl>C:\publish\SolutionName\Exam</publishUrl>
In the build pipeline (in TFS) with have MSBuild step with this argument:
/p:PublishProfile=build.pubxml
After the build we got 2 folders - Test
and Exam
in C:\publish\SolutionName
.
So far so good.
The problem is we have few branches, and we want to separate the publish folder for each branch, so we added .pubxml
for each branch and in the build pipeline we specified the correct one. but is make are a lot of work on each new branch created and can cause mistakes.
We tried to pass the /p:publishUrl=C:\publish\BranchName
in the MSBuild but then we got a one folder with all the content of Test
and Exam
and not two folders.
The idea is to have only one .pubxml
file for each project with a parameter and pass the value in the pipeline, for example:
<publishUrl>C:\publish\$(Parameter)\Test</publishUrl>
And in the build we will pass the parameter according to the branch.
It is possible to do something like this?