visual studio 2012 - Have to build 2 solutions, one per project -


we have build 2 solutions central on tfs server. 1 solution framework, other includes services, should build separately per project in order deploy them later via script.

in addition framework assemblies copied (base) project within framework solution. projects of second solution referring 'base' project.

my problem is, have no idea, how configure solutions, project , builds, behave request illustrated above.

please help.

note: don't want put each service project msi in order install it. want deploy service out of central drop-folder on tfs server.

  1. team build can build multiple solutions in build process template. click [...] button behind projects build , add both solutions.

  2. tfs redirects output directory of projects, break script copies output "base project" of b. in order turn of redirection set output location asconfigured.

  3. now tfs won't know how copy output binaries folder, serves source copy droplocation action. solve you'll need write powershell script , configure post-build script.

enter image description here

the process create drop script clearly documented on msdn , sample script available codeplex.

##----------------------------------------------------------------------- ## <copyright file="gatheritemsfordrop.ps1">(c) http://tfsbuildextensions.codeplex.com/. source subject microsoft permissive license. see http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx. other rights reserved.</copyright> ##----------------------------------------------------------------------- # copy binaries bin directory  # build server can drop them # staging location specified on build defaults tab  # # see  #   http://msdn.microsoft.com/en-us/library/bb778394(v=vs.120).aspx #   http://msdn.microsoft.com/en-us/library/dd647547(v=vs.120).aspx#scripts       # enable -verbose option [cmdletbinding()]  # disable parameter # convenience option can debug script or disable in  # build definition without having remove # 'post-build script path' build process parameter. param([switch]$disable) if ($psboundparameters.containskey('disable')) {     write-verbose "script disabled; no actions taken on files." }  # script copies basic file types managed code projects. # can change list meet needs. $filetypes = $("*.exe","*.dll","*.exe.config","*.pdb")  # specify sub-folders include $sourcesubfolders = $("*bin*","*obj*")  # if script not running on build server, remind user  # set environment variables script can debugged if(-not $env:tf_build -and -not ($env:tf_build_sourcesdirectory -and $env:tf_build_binariesdirectory)) {     write-error "you must set following environment variables"     write-error "to test script interactively."     write-host '$env:tf_build_sourcesdirectory - example, enter like:'     write-host '$env:tf_build_sourcesdirectory = "c:\code\fabrikamtfvc\helloworld"'     write-host '$env:tf_build_binariesdirectory - example, enter like:'     write-host '$env:tf_build_binariesdirectory = "c:\code\bin"'     exit 1 }  # make sure path source code directory available if (-not $env:tf_build_sourcesdirectory) {     write-error ("tf_build_sourcesdirectory environment variable missing.")     exit 1 } elseif (-not (test-path $env:tf_build_sourcesdirectory)) {     write-error "tf_build_sourcesdirectory not exist: $env:tf_build_sourcesdirectory"     exit 1 } write-verbose "tf_build_sourcesdirectory: $env:tf_build_sourcesdirectory"  # make sure path binary output directory available if (-not $env:tf_build_binariesdirectory) {     write-error ("tf_build_binariesdirectory environment variable missing.")     exit 1 } if ([io.file]::exists($env:tf_build_binariesdirectory)) {     write-error "cannot create output directory."     write-error "file name $env:tf_build_binariesdirectory exists."     exit 1 } write-verbose "tf_build_binariesdirectory: $env:tf_build_binariesdirectory"  # tell user script write-verbose "will , gather " write-verbose "$filetypes files from" write-verbose "$env:tf_build_sourcesdirectory , copy them " write-verbose $env:tf_build_binariesdirectory  # find files $files = gci $env:tf_build_sourcesdirectory -recurse -include $sourcesubfolders |      ?{ $_.psiscontainer } |      foreach { gci -path $_.fullname -recurse -include $filetypes } if($files) {     write-verbose "found $($files.count) files:"      foreach ($file in $files) {         write-verbose $file.fullname      } } else {     write-warning "found no files." }  # if binary output directory exists, make sure empty # if not exist, create 1 # (this happens when 'clean workspace' build process parameter set true) if ([io.directory]::exists($env:tf_build_binariesdirectory))  {      $deletepath = $env:tf_build_binariesdirectory + "\*"     write-verbose "$env:tf_build_binariesdirectory exists."     if(-not $disable)     {         write-verbose "ready delete $deletepath"         remove-item $deletepath -recurse         write-verbose "files deleted."     }    }  else {      write-verbose "$env:tf_build_binariesdirectory not exist."      if(-not $disable)     {         write-verbose "ready create it."         [io.directory]::createdirectory($env:tf_build_binariesdirectory) | out-null         write-verbose "directory created."     } }   # copy binaries  write-verbose "ready copy files." if(-not $disable) {     foreach ($file in $files)      {         copy $file $env:tf_build_binariesdirectory     }     write-verbose "files copied." } 

a better solution have 2 separate builds first build publishes dependencies of second project nuget package. the microsoft alm rangers have delivered guide explains how set up.


Comments