Search code examples
asp.netwpftfstfsbuild

TFS 2015 Build files and Publish websites


I recently started working with TFS 2015 (Update 4). And I'm trying to configure and build to do the folowing:

  • Restore nuget packets
  • Build whole solution
  • Publish (move to specific uri)

My solution has the folowing structure:

  • Solution

    • DALs (EF6 code first model)
    • WPF App 1
    • ASP.NET Website 1
    • WPF App 2
    • ASP.NET Website 2

Note: Both Websites have publish profiles named "Publish", and both are same except the publishUrl inside of them.

 <PropertyGroup>
    <WebPublishMethod>FileSystem</WebPublishMethod>
    <PublishProvider>FileSystem</PublishProvider>
    <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
    <LastUsedPlatform>Any CPU</LastUsedPlatform>
    <SiteUrlToLaunchAfterPublish />
    <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
    <ExcludeApp_Data>False</ExcludeApp_Data>
    <publishUrl>..\Deploy\AppServerHost</publishUrl>
    <DeleteExistingFiles>False</DeleteExistingFiles>
  </PropertyGroup>

What have I tried on TFS... The build And the publish: publishing the artifact

What I'm trying to acomplish, is that when I start the build, it should build the whole solution, copy the release of WPF regulary, and most important, not just build the websites, it should also publish them. Because now I only get their bins.


Solution

  • To build the whole solution, you need to make sure you have mapped all your projects/the whole solution folder in Repository tab, and specify the solution or use **\*.sln (you have already done this according to your screenshot) in Visual Studio Build task:

    enter image description here

    You only get bins because you only specify **\binin Contents of Copy and Publish Build Artifacts task. Since you are using TFS 2015.4, we recommend that you do not use Copy and Publish Build Artifacts task, it's deprecated. Instead, you should use the Copy Files and Publish Build Artifacts tasks.

    In Copy Files task, specify match pattern filters (one on each line) that you want to apply to the list of files to be copied.

    In Publish Build Artifacts task, specify the path to the folder or file you want to publish. You could refer to the links for more details.