msbuild - How to automate Visual Studio 2017 web project publish to folder -


i trying create powershell v5 script build , publish vs2017 wcf web service application (.net framework 4) can automate in bamboo. have msbuild command working build correctly , need publish project folder using folderprofile.

i can manually success right-clicking on project , selecting publish, selecting folderprofile. puts files need deployed website in project's bin\release\publishoutput location. want automate publishaction in powershell script.

i have tried recommendation on sayed hashimi's site, similar below (i use vs2017 version of 15.2, and, of course, replace project name , profile actual values);

msbuild myproject.csproj /p:deployonbuild=true /p:publishprofile=<profile-name> /p:password=<insert-password> /p:visualstudioversion=15.2  

but did not put files in bin\release\publishoutput location. looked did standard build.

edit:

msbuild lists line in output when run above command;

deploymentunpublishable:     skipping unpublishable project. 

i have looked through this post on github , have cited solution updating v15.2 of vs2017, have done;

microsoft visual studio enterprise 2017 version 15.2 (26430.16) release 

any ideas?

edit - solution

@leo-msft provided solution...

msbuild myproject\myproject.vbproj /p:deployonbuild=true /p:publishprofile=folderprofile.pubxml /p:configuration=release 

this put files bin\release\publishoutput.

i had spent several days searching solution , had added various command parameters suggested in other , github forum posts, such /t:publish, /p:publishprofilerootfolder , /p:visualstudioversion=15.2. removed , used line above created published output needed.

this did not put files in bin\release\publishoutput location. looked did standard build

i have reproduced issue command line. after research issue long time, try remove parameter "/p:visualstudioversion=15.2", re-publish project command line:

msbuild myproject.csproj /p:deployonbuild=true /p:publishprofile="myprofile.pubxml" 

it build , publish successfully, , web project publish folder set in option "<publishurl>" in myprofile.pubxml.

so please try remove parameter "/p:visualstudioversion" in msbuild command line, check if works you.

note: have test command line visualstudioversion project created visual studio 2015, works fine. not sure whether issue visual studio 2017, need confirm it, if it`s issue visual studio 2017, send issue visual studio team.


Comments

Popular posts from this blog

javascript - Create a stacked percentage column -

Optimising Firebase database by automatically overwriting data -

javascript - Angular UI-Grid customTemplate directive causing rows to load slowly/? -