.net - Skip rule is not working -
i've edited csproj file according post, files in app_data deleted anyway. on other hand, when modify msdeploy command shown in post, skip applied.
i'm using web deploy v3. , command
msdeploy.exe" -verb:sync -source:package=c:\builds\app.zip -dest:auto -setparam:"iis web application name"="default web site/app"
is there anyway debug can causing behavior ?
<propertygroup> <onbeforepackageusingmanifest>addcustomskiprules</onbeforepackageusingmanifest> </propertygroup> <target name="addcustomskiprules"> <itemgroup> <msdeployskiprules include="skipdeleteappdata"> <skipaction>delete</skipaction> <objectname>filepath</objectname> <absolutepath>$(_escaped_packagetempdir)\\app_data\\.*</absolutepath> <xpath> </xpath> </msdeployskiprules> <msdeployskiprules include="skipdeleteappdata"> <skipaction>delete</skipaction> <objectname>dirpath</objectname> <absolutepath>$(_escaped_packagetempdir)\\app_data\\.*</absolutepath> <xpath> </xpath> </msdeployskiprules> </itemgroup> </target>
i've been reviewing microsoft.web.publishing.targets , looks implemented, need add property msbuild script:
<propertygroup> <skipapp_datafolder>true</skipapp_datafolder> </propertygroup>
if running msbuild command line can use:
msbuild myproject.csproj /p:skipapp_datafolder=true ...
update:
you may want try this, put code @ bottom of msbuild file, after "import" tags:
<target name="generateskipruleforappdata"> <escapetextforregularexpressions text="$(_packagetempdir)"> <output taskparameter="result" propertyname="_escaped_packagetempdir" /> </escapetextforregularexpressions> <itemgroup> <msdeployskiprules include="skipadddataondeploy"> <skipaction></skipaction> <objectname>dirpath</objectname> <absolutepath>$(_escaped_packagetempdir)\\app_data$</absolutepath> <xpath></xpath> </msdeployskiprules> </itemgroup> </target>
this exact copy of "generateskipruleforappdata" target microsoft.web.publishing.targets without condition (seems condition not working properly), overwrite original target , should force executed without break logic of targets.
Comments
Post a Comment