MS Web Deploy Skip Delete Rule does not skip

I added the following skip rule to my project, but when I use Web Deploy to publish content, the files in the / config folder are erased.

I use the found process here , and I swear that it worked previously.

I added the following to the project file:

<PropertyGroup>
    <OnBeforePackageUsingManifest>AddCustomSkipRules</OnBeforePackageUsingManifest>
</PropertyGroup>
<Target Name="AddCustomSkipRules">
    <ItemGroup>
      <MsDeploySkipRules Include="SkipConfigFolder">
        <SkipAction>Delete</SkipAction>
        <ObjectName>dirPath</ObjectName>
        <AbsolutePath>.*\\config\\$</AbsolutePath>
        <XPath></XPath>
      </MsDeploySkipRules>
      <MsDeploySkipRules Include="SkipConfigSubFolders">
        <SkipAction>Delete</SkipAction>
        <ObjectName>dirPath</ObjectName>
        <AbsolutePath>.*\\config\\.*$</AbsolutePath>
        <XPath></XPath>
      </MsDeploySkipRules>  
    </ItemGroup>
</Target>

When I publish (via the command line, using the cmd file generated by the package), the following is output:

-------------------------------------------------------
 Start executing msdeploy.exe
-------------------------------------------------------
 "C:\Program Files\IIS\Microsoft Web Deploy V2\\msdeploy.exe" 
   -source:package='<MyPackageFile>' 
   -dest:auto,includeAcls='False' 
   -verb:sync 
   -disableLink:AppPoolExtension 
   -disableLink:ContentExtension 
   -disableLink:CertificateExtension 
   -skip:skipaction='Delete',objectname='dirPath',absolutepath='.*\\config\\$' 
   -skip:skipaction='Delete',objectname='dirPath',absolutepath='.*\\config\\.*$' 
   -setParamFile:"<MySetParameters.xml>"
Info: Deleting filePath (Default Web Site/uPPK_32\config\New Text Document.txt).

It seems like a skip rule is being added, but it is noticed that the new Document.txt text is being deleted. How can I prevent this? Did I miss something?

+5
source share
2 answers

I think your second skip line should use filePath instead of DirPath, as you select files there.

+3

absolutePath - , , , , '\\config' '\\config$', , .

+3

All Articles