How to use the Web Publishing Pipeline and Web Deploy (MSDEPLOY) to Publish a Console Application? -
i use web deploy publish visual studio "console" application folder on target system.
i have had luck, , have been able produce similar need, not quite.
i've added following console .csproj:
added following projectname.wpp.targets file
<import project="$(msbuildextensionspath32)\microsoft\visualstudio\v10.0\webapplications\microsoft.webapplication.targets" />
and i've added following projectname.wpp.targets:
<project defaulttargets="build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" toolsversion="4.0"> <propertygroup> <deployasiisapp>false</deployasiisapp> <includesetaclproviderondestination>false</includesetaclproviderondestination> </propertygroup> <itemgroup> <filesforpackagingfromproject include="$(intermediateoutputpath)$(targetfilename).config"> <destinationrelativepath>bin\%(recursivedir)%(filename)%(extension)</destinationrelativepath> <fromtarget>projectname.wpp.targets</fromtarget> </filesforpackagingfromproject> </itemgroup> </project>
i edit .setparameters.xml file follows:
<parameters> <setparameter name="iis web application name" value="c:\company\project" /> </parameters>
when deploy using generated .cmd file, files deployed c:\company\project\bin.
that's not bad, i'd better. in particular, i'd omit "bin" folder , put files in "c:\company\project" folder, , i'd able specify acls
has been able work around these problems?
ok, here's way how omit 'bin' folder.
first of all, i'd emphasize msdeploy-related stuff web apps deployment, , 'bin' folder seems me almost hardcoded inside. if want rid of - have dirty things. did.
we'll have change $(msbuildextensionspath32)\microsoft\visualstudio\v10.0\webapplications\microsoft.webapplication.targets
project little bit, it's better change not it, it's copy.
steps:
1.backup $(msbuildextensionspath32)\microsoft\visualstudio\v10.0\webapplications\microsoft.webapplication.targets
(alternatively, install msbuild.microsoft.visualstudio.web.targets package, redirect csproj file microsoft.webapplication.targets
file obtained package , work it).
2. in $(msbuildextensionspath32)\microsoft\visualstudio\v10.0\webapplications\microsoft.webapplicaton.targets
find xml node looks <copypipelinefiles pipelineitems="@(filesforpackagingfromproject)"
(there several ones of them, take 1 line ~2570).
3. comment node out, replace custom one, like:
<!-- <copypipelinefiles pipelineitems="@(filesforpackagingfromproject)" sourcedirectory="$(webpublishpipelineprojectdirectory)" targetdirectory="$(wppallfilesinsinglefolder)" skipmetadataexcludetrueitems="true" updateitemspec="true" deleteitemsmarkasexcludetrue ="true" condition="'@(filesforpackagingfromproject)' != ''"> <output taskparameter="resultpipelineitems" itemname="_filesforpackagingfromprojecttempory"/> </copypipelinefiles>--> <!-- copying files package folder in 'custom'(dirty) way --> <createitem include="$(outputpath)\**\*.*"> <output taskparameter="include" itemname="yourfilestocopy" /> </createitem> <copy sourcefiles="@(yourfilestocopy)" destinationfiles="@(yourfilestocopy->'$(wppallfilesinsinglefolder)\%(recursivedir)%(filename)%(extension)')" />
then
4. projectname.wpp.targets don't have have filesforpackagingfromproject
, like:
<!-- targets --> <propertygroup> <deployasiisapp>false</deployasiisapp> <includesetaclproviderondestination>false</includesetaclproviderondestination> </propertygroup> <itemgroup> <!-- intentionally left blank --> </itemgroup> </project>
that's it. worked me(tm), tested. let me honest, don't approach, way made working in needed way. it's whether you'll use in project or not.
my opinion not use msdeploy here - not task.
better write msbuild-scripts scratch or accept 'bin' folder, , fight against framework again once next customization required.
Comments
Post a Comment