8

We have a solution that contains 17 projects. Solution has several configurations such as Debug, Release, Test, Publish and etc.

Also team project has several build definitions, each one is specialized for a configuration. We use Release configuration build for nightly builds and Publish configuration build for publish and deployment. So these build definitions, build same source code. But there is a problem...

Our nightly build creates obj\Release directories for each project but publish build doesn't. Because of this publish build doesn't create server publish package.

When I looked to the build logs I saw the differences like below. Nightly build - Release configuration (for each project)

PrepareForBuild:
  Creating directory "obj\Release\".

Publish build - Publish configuration (for each project)

_DeploymentUnpublishable:
  Skipping unpublishable project.

But I couldn't understand why? Which flag controls this?

We are using TFS 2010, so Team Build 2010.

jessehouwing
  • 106,458
  • 22
  • 256
  • 341
bahadir arslan
  • 4,535
  • 7
  • 44
  • 82
  • Read the rest of the log file around the "unpublishable" message to see if it tells you why the project was unpublishable. Also, maybe set the logging level to "Verbose" oto get more detail. – John Saunders Dec 28 '11 at 08:40

1 Answers1

6

Try adding the following deployment settings to the project file inside the property group for the build configuration you want to publish:

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    ...
    <FilesToIncludeForPublish>OnlyFilesToRunTheApp</FilesToIncludeForPublish>
    <DeployOnBuild>true</DeployOnBuild>
    <DeployTarget>Package</DeployTarget>
    <PackageAsSingleFile>true</PackageAsSingleFile>
</PropertyGroup>

I was getting a similar error on a web project's CI build. Adding the deployment settings to the web.csproj file corrected it.

Chris Morgan
  • 1,074
  • 11
  • 11
  • 1
    These properties should already be defined in the `.pubxml` file for the publish. If this fixes it, it means the pubxml is missing or incomplete. – jpaugh Oct 09 '19 at 18:19