msbuild icon indicating copy to clipboard operation
msbuild copied to clipboard

MSBuild commandline seems to ignore publish properties

Open paleocomburo opened this issue 9 years ago • 96 comments

I'm trying to use msbuild to publish my application to a filesystem location. I've setup a profile from inside VS2017 and from there it works perfectly. When I run msbuild from the commandline: "msbuild application.sln /p:DeployOnBuild=true /p:PublishProfile=publishprofile" it builds the default "Debug|x86" target and nothing else. Nothing is published and the target in the publish profile is set to "release". When I specify a non-existing publish profile it still build like above, while I would expect an error telling me I specified a non-existing profile.

paleocomburo avatar Mar 23 '17 16:03 paleocomburo

+1 I'm having the same issue. The following command builds correctly, but doesn't output anything to the deploy target. The exact same command works on a machine with VS2015 installed.

"C:\Program Files (x86)\MSBuild\14.0\Bin\msbuild.exe" /t:Build;Publish TCA.Web\TCA.Web.csproj /p:DeployOnBuild=true /p:PublishProfile=Deploy.pubxml /p:Configuration=Release

I see the following in the build output, but unable to extract why it happens. _DeploymentUnpublishable: Skipping unpublishable project.

It works from the Visual Studio 2017 UI. I'm running build 15.0.0+26228.10

oexenhave avatar Mar 29 '17 09:03 oexenhave

Same for me.

frbar avatar Mar 31 '17 15:03 frbar

Same for me too,

faemm avatar Apr 11 '17 07:04 faemm

Same for me

ducseb avatar Apr 21 '17 13:04 ducseb

Same for me

ewilli avatar Apr 24 '17 09:04 ewilli

Hi, still no news from Microsoft's guys? MSBuild 14 cannot build C# 7 code.

Is it possible to build with v15 and do the publish (and only the publish) with 14?

frbar avatar Apr 24 '17 11:04 frbar

Same here

tran-barry avatar Apr 24 '17 21:04 tran-barry

Same for me

deadlydog avatar Apr 26 '17 14:04 deadlydog

Same here.

jamest-iqmetrix avatar Apr 26 '17 16:04 jamest-iqmetrix

Ditto.

vicp-iq avatar Apr 26 '17 16:04 vicp-iq

Same here

RyanMarcotte avatar Apr 26 '17 16:04 RyanMarcotte

Me as well

andrewk-iq avatar Apr 26 '17 17:04 andrewk-iq

Same here. I try to run publish only (This method worked in previous versions) MSBuild <PROJECT_PATH> /t:publish /p:PublishProfile=<PUBLISH_PROFILE_PATH> /p:PublishRootDir=<PATH_VARIABLE_FOR_THE_PROFILE> /p:Configuration=Release

shkup avatar Apr 27 '17 07:04 shkup

I'm also encountering the same problem

VincentLangevin avatar Apr 27 '17 14:04 VincentLangevin

I tried to reproduce this but don't think I did, on a new WebApplication type project created in VS2015 U3 and published on the command line from both VS2015 U3 and VS2017 15.1.

Can someone affected by this please post repro steps that are excruciatingly clear, for someone who has never used "publish" before like me? Ideally with a small repro project I could build in various ways, and explicit descriptions of the behavior you expect and what you see instead.

rainersigwald avatar Apr 27 '17 22:04 rainersigwald

I'm not the original reporter, but experienced this issue attempting to configure a build agent without Visual Studio - using https://aka.ms/vs/15/release/vs_buildtools.exe - excerpt from PS script:

&.\vs_buildtools.exe `
  --add Microsoft.VisualStudio.Workload.MSBuildTools `
  --add Microsoft.VisualStudio.Workload.WebBuildTools `
  --includeRecommended --includeOptional `
  --passive `
  --norestart

mattlwilliams avatar Apr 27 '17 23:04 mattlwilliams

Same here: that's ok with Enterprise VS 2017 on development machine, but nothing is published when running the same build command on a Jenkins box with the build tools (no VS installed).

frbar avatar Apr 28 '17 06:04 frbar

Very annoying issue, has anyone found a workaround when using TFS?

We have the VS 2017 build tools installed on our build agent and see this issue with publishprofile + DeployOnBuild=true

adam-knights avatar May 03 '17 13:05 adam-knights

We can't move forward with msbuild 15 because of this.

ehaackXceligent avatar May 10 '17 16:05 ehaackXceligent

I had this issue even with VS 2017 Enterprise installed. I had to re-run the Enterprise installer and select the component "ASP.NET and web development tools" in order to get web publish to work from the build server. Now that I think about it, this seems very similar to a problem I had back around VS 2012/2013 that required the Azure SDK to be installed for web publish to work (even though I didn't need to install any Azure components this time around).

doughless avatar May 12 '17 16:05 doughless