Specifying the projectname within the DesktopPackageLocation during the Visual Studio Build task in TFS 2018

Arjay H.

Folks,

I'm using the Visual Studio Build task in TFS 2018 to build multiple .NET Core 2.0 web applications.

The solution parameter is: **\WebApp.*.sln

Where each solution is something like WebApp.Prj1.sln, WebApp.Prj2.sln, etc.

The MSBuild arguments are: /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=false /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="$(build.artifactstagingdirectory)\WebApp.zip"

What I would like is to create the webapp.zip file specific to the solution I'm building. In other words, something like: /p:DesktopBuildPackageLocation="$(build.artifactstagingdirectory)\$(build.projectname).zip"

I don't seem to be able to find a built-in variable that allows me to access the solution or project name getting built.

Is this possible? If not, can someone post the equivalent powershell script that emulates the Visual Studio Build task so I can manually create the zipfile with the project name?

Thanks.

PatrickLu-MSFT

This is not supported by default and there is no built-in variable either.

If you want to customize the PowerShell script of Visual Studio build task. You could find the VSBuild.ps1 script under the build agent working directory _work/vstsbuildxxtask folder on your build agent machine.

Take a look at this thread: Visual Studio Build step should allow multiple paths

Another way is using multiple Visual Studio Build tasks combined with Copy and Publish Build Artifacts to handle multiple $(build.artifactstagingdirectory)\$(build.projectname).zip packages per project.


Update:

There already been a related uservoice entry here: Using Variable in Solution Path in a Visual Studio Build Task

For your request, as a workaround, you could apply the whole solution path as a build variable and change it at build time. That means define a variable and set the value "$/repository/Development/Prj1/website name.sln". If you want build Prj2, change the Prj1 to Prj2 when queuing the build.

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

TFS Visual Studio Build task doesn't recognise macro DevEnvDir during post build event

分類Dev

TFS2018のVisualStudioビルドタスク中にDesktopPackageLocation内でプロジェクト名を指定する

分類Dev

Using TFS without Visual Studio

分類Dev

Predefined type 'System.Void' is not defined or imported during Visual Studio Online build of ASP.NET 5

分類Dev

How to add a new Activity type to the Task work item in TFS 2018

分類Dev

How to execute SQL in a PowerShell script as part of a Visual Studio Team Services build task?

分類Dev

Azure DevOps Build Task: create a zip with contents identical to Visual Studio Publish

分類Dev

How do I Run Nunit Tests As a Post-Build Task in Visual Studio?

分類Dev

Visual studio 2013 "A task was cancelled"

分類Dev

Are TFS Build Agent User Capabilities' Values Obtainable Within Build Steps?

分類Dev

Visual Studio TFS Git not seeing any changes

分類Dev

Unshelve changes in TFS Visual Studio 2013

分類Dev

MATLAB File Association in Visual Studio 2015 / TFS

分類Dev

How to connect Visual Studio 2019 to TFS?

分類Dev

Visual Studio 2017 Enterprise + TFS 2018 + Git Clone =ローカル発行者証明書を取得できません

分類Dev

How to simply create a folder with a task on TFS 2017 build definition?

分類Dev

Run another yarn/npm task within a package.json, without specifying yarn or npm

分類Dev

Grunt watch task binding in Visual Studio 2015

分類Dev

Changing "Color theme" within a Visual Studio Extension

分類Dev

visual studio 2013 hide build progress window

分類Dev

cmake + qt + visual studio: moc objects on build

分類Dev

Visual studio Online build services, git tag

分類Dev

Visual Studio command line build arguments

分類Dev

Can I use Git client with TFS - but without Visual Studio?

分類Dev

Change TFS source control mapping in Visual Studio 2013

分類Dev

How to manage class library evolution in Visual Studio 2013/TFS?

分類Dev

Visual Studio 2013ProfessionalとTFS2013 Express

分類Dev

Visual Studio 2017TFS統合-.netCore 2

分類Dev

Visual Studio2019およびTFS2018のプロセステンプレートエディターで遷移リンクを追加できません

Related 関連記事

  1. 1

    TFS Visual Studio Build task doesn't recognise macro DevEnvDir during post build event

  2. 2

    TFS2018のVisualStudioビルドタスク中にDesktopPackageLocation内でプロジェクト名を指定する

  3. 3

    Using TFS without Visual Studio

  4. 4

    Predefined type 'System.Void' is not defined or imported during Visual Studio Online build of ASP.NET 5

  5. 5

    How to add a new Activity type to the Task work item in TFS 2018

  6. 6

    How to execute SQL in a PowerShell script as part of a Visual Studio Team Services build task?

  7. 7

    Azure DevOps Build Task: create a zip with contents identical to Visual Studio Publish

  8. 8

    How do I Run Nunit Tests As a Post-Build Task in Visual Studio?

  9. 9

    Visual studio 2013 "A task was cancelled"

  10. 10

    Are TFS Build Agent User Capabilities' Values Obtainable Within Build Steps?

  11. 11

    Visual Studio TFS Git not seeing any changes

  12. 12

    Unshelve changes in TFS Visual Studio 2013

  13. 13

    MATLAB File Association in Visual Studio 2015 / TFS

  14. 14

    How to connect Visual Studio 2019 to TFS?

  15. 15

    Visual Studio 2017 Enterprise + TFS 2018 + Git Clone =ローカル発行者証明書を取得できません

  16. 16

    How to simply create a folder with a task on TFS 2017 build definition?

  17. 17

    Run another yarn/npm task within a package.json, without specifying yarn or npm

  18. 18

    Grunt watch task binding in Visual Studio 2015

  19. 19

    Changing "Color theme" within a Visual Studio Extension

  20. 20

    visual studio 2013 hide build progress window

  21. 21

    cmake + qt + visual studio: moc objects on build

  22. 22

    Visual studio Online build services, git tag

  23. 23

    Visual Studio command line build arguments

  24. 24

    Can I use Git client with TFS - but without Visual Studio?

  25. 25

    Change TFS source control mapping in Visual Studio 2013

  26. 26

    How to manage class library evolution in Visual Studio 2013/TFS?

  27. 27

    Visual Studio 2013ProfessionalとTFS2013 Express

  28. 28

    Visual Studio 2017TFS統合-.netCore 2

  29. 29

    Visual Studio2019およびTFS2018のプロセステンプレートエディターで遷移リンクを追加できません

ホットタグ

アーカイブ