1
votes

There is a VS2013 solution with multiple web projects. And only two of them should be published on TFS 2013 server. Both projects have a valid build.pubxml own publish profiles. Other web projects don't have publish profiles because I don't want to publish them.

TFS build is broken with the following exception: C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.targets (4346): The value for PublishProfile is set to 'build.pubxml', expected to find the file at 'C:\Builds\1...\PublishProfiles\build.pubxml' but it could not be found.

My question is how I can ignore projects publishing?

1

1 Answers

2
votes

EDIT: Updated as my original answer didn't work and caused the build to blow up. have now suggested to create a zip package, but to not actually deploy the web application. Same Idea different implementation

Add dummy build.pubxml file to each of the unwanted projects and set them to not publish, but to generate a package, will work and not automatically publish the site.

<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit http://go.microsoft.com/fwlink/?LinkID=208121. 
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <WebPublishMethod>Package</WebPublishMethod>
    <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
    <LastUsedPlatform>Any CPU</LastUsedPlatform>
    <SiteUrlToLaunchAfterPublish />
    <LaunchSiteAfterPublish>False</LaunchSiteAfterPublish>
    <ExcludeApp_Data>True</ExcludeApp_Data>
    <DesktopBuildPackageLocation>Webapplication2.zip</DesktopBuildPackageLocation>
    <PackageAsSingleFile>true</PackageAsSingleFile>
    <DeployIisAppPath>webapplication2</DeployIisAppPath>
    <PublishDatabaseSettings>
      <Objects xmlns="" />
    </PublishDatabaseSettings>
  </PropertyGroup>
</Project>

This should allow the build to find a publishing profile, Create a zip file for the unwanted web apps but not actually deploy them.