Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why Unpublishable?

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.

like image 972
bahadir arslan Avatar asked Dec 28 '11 08:12

bahadir arslan


1 Answers

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.

like image 176
Chris Morgan Avatar answered Nov 24 '22 14:11

Chris Morgan