0
votes

I'm at a total loss. We have TeamCity installed (TeamCity Professional 2017.2.3 (build 51047)). We run the MSBuild step with:

MSBuildVersion: Microsoft Build Tools 2017
MSBuild Tools Version: 15.0

and Command Parameters:

/t:Clean /p:DeployOnBuild=true /t:build /t:publish /p:PublishProfile=Properties\PublishProfiles\Deploy.pubxml /p:PublishDirectory=Deployment /p:Configuration=Release /p:VisualStudioVersion=15.0

When we run the build t shows:

_DeploymentUnpublishable [11:16:53][_DeploymentUnpublishable] Skipping unpublishable project.

TeamCity outputs at the start:

Starting: C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.MsBuildBootstrap.exe /workdir:C:\TeamCity\buildAgent\work\c36dd5b119aec7b "/msbuildPath:C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\bin\MSBuild.exe"

If I navigate to the msbuildPath in the CommandLine and run the same command it builds and publishes without issue.

Any help would be greatly appreciated.

MSBuild Step In TeamCity: enter image description here

1
Try to set up correct SolutionDir, something like this: /p:SolutionDir="%teamcity.build.workingDir%". Of course make sure the path is correct; modify it if your solution file is not directly in your working directory.Peska
Thanks for the response, no luck I'm afraid, same error. It's a strange one that it works fine from the command line. I'd rather not swap to using a command line build step instead of the MSBuild step but it's getting to that point.user351711
Maybe show us your build step from TeamCity.Peska
I've added the picture but it's all very basic, the exact same command line params run against C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin> works without issueuser351711
When you're testing this manually at the command line, are you doing it on the build agent or another machine? And have you tried running it under the same user the TeamCity agent is running under?Nanhydrin

1 Answers

0
votes

I had this issue and resolved it by setting a Parameter towards the publishing profile.

This is what i had: - *.csproj would build and publish in visual studio locally. - TeamCity builds fine but when asked to Publish sends me the not helpful _deploymentunpublishable

I tried all the commands in the msbuild line but only the following setup works:

pre-step: Create a Publishing profile (*.pubxml) which outputs to a folder within your build. This should be saved in your /Properties folder of the build.

  1. inside your configuration page, go to Parameters.
  2. Add a new Parameter for "System". Call it PublishProfile (system.PublishProfile). Give it a vaule which is the name of your publish profile file or *.pubxml enter image description here
  3. create a new step (or amend existing publish step), runner type "MSBuild" and in the Targets box type WebPublish enter image description here
  4. You dont need any command line parameters as your pubxml will handle all this.

Thats it, give it a try and your code should now publish to the folder you set in the publishing profile.