I've added the following skip rule to my project but when I use Web Deploy to publish the contents, the files in the /config folder are being wiped out.
I'm using the process found here and I swear it was working previously.
I've added the following to my 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 command-line using the cmd file generated by the package), the following is outputted:
-------------------------------------------------------
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 looks like the skip rule is being added but notice New Text Document.txt is being deleted. How can I prevent this? Am I missing something?
I think your second skip line needs to use filePath instead of DirPath, as you're selecting files there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With