Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8133379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:35:10+00:00 2026-06-06T09:35:10+00:00

I want MSDeploy to skip specific folders and file types within other folders when

  • 0

I want MSDeploy to skip specific folders and file types within other folders when using sync. Currently I’m using CCNet to call MSDeploy with the sync verb to take websites from a build to a staging server. Because there are files on the destination that are created by the application / user uploaded files etc, I need to exclude specific folders from being deleted on the destination. Also there are manifest files created by the site that need to remain on the destination.

At the moment I’ve used -enableRule:DoNotDeleteRule but that leaves stale files on the destination.

<exec>
    <executable>$(MsDeploy)</executable>
    <baseDirectory>$(ProjectsDirectory)$(projectName)$(ProjectsWorkingDirectory)\Website\</baseDirectory>
    <buildArgs>-verb:sync 
        -source:iisApp="$(ProjectsDirectory)$(projectName)$(ProjectsWorkingDirectory)\Website\" 
        -dest:iisApp="$(website)/$(websiteFolder)"
        -enableRule:DoNotDeleteRule</buildArgs>
    <buildTimeoutSeconds>600</buildTimeoutSeconds>
    <successExitCodes>0,1,2</successExitCodes>
</exec>

I have tried to use the skip operation but run into problems. Initially I dropped the DoNotDeleteRule and replaced it with (multiple) skip

<exec>
    <executable>$(MsDeploy)</executable
    <baseDirectory>$(ProjectsDirectory)$(projectName)$(ProjectsWorkingDirectory)\Website\</baseDirectory>
    <buildArgs>-verb:sync 
        -source:iisApp="$(ProjectsDirectory)$(projectName)$(ProjectsWorkingDirectory)\Website\" 
        -dest:iisApp="$(website)/$(websiteFolder)"
        -skip:objectName=dirPath,absolutePath="assets" 
        -skip:objectName=dirPath,absolutePath="survey" 
        -skip:objectName=dirPath,absolutePath="completion/custom/complete*.aspx" 
        -skip:objectName=dirPath,absolutePath="completion/custom/surveylist*.manifest" 
        -skip:objectName=dirPath,absolutePath="content/scorecardsupport" 
        -skip:objectName=dirPath,absolutePath="Desktop/docs" 
        -skip:objectName=dirPath,absolutePath="_TempImageFiles"</buildArgs>         
    <buildTimeoutSeconds>600</buildTimeoutSeconds>
    <successExitCodes>0,1,2</successExitCodes>
</exec>

But this results in the following:

Error: Source (iisApp) and
destination (contentPath) are not compatible for the given
operation.
Error count:
1.

So I changed from iisApp to contentPath and instead of dirPath,absolutePath just Directory like this:

<exec>
    <executable>$(MsDeploy)</executable
    <baseDirectory>$(ProjectsDirectory)$(projectName)$(ProjectsWorkingDirectory)\Website\</baseDirectory>
    <buildArgs>-verb:sync 
        -source:contentPath="$(ProjectsDirectory)$(projectName)$(ProjectsWorkingDirectory)\Website\" 
        -dest:contentPath="$(website)/$(websiteFolder)"
        -skip:Directory="assets" 
        -skip:Directory="survey" 
        -skip:Directory="content/scorecardsupport" 
        -skip:Directory="Desktop/docs" 
        -skip:Directory="_TempImageFiles"</buildArgs>           
    <buildTimeoutSeconds>600</buildTimeoutSeconds>
    <successExitCodes>0,1,2</successExitCodes>
</exec>

and this gives me an error: Illegal characters in path:

< buildresults>
Info: Adding MSDeploy.contentPath (MSDeploy.contentPath).
Info: Adding contentPath (C:\WWWRoot\MySite
-skip:Directory=assets
-skip:Directory=survey
-skip:Directory=content/scorecardsupport
-skip:Directory=Desktop/docs
-skip:Directory=_TempImageFiles).
Info: Adding dirPath (C:\WWWRoot\MySite
-skip:Directory=assets
-skip:Directory=survey
-skip:Directory=content/scorecardsupport
-skip:Directory=Desktop/docs
-skip:Directory=_TempImageFiles).
< /buildresults>

< buildresults>
Error: Illegal characters in path.
Error count: 1.
< /buildresults>

So I need to know how to configure this task so the folders referenced do not have their contents deleted in a sync and that that *.manifest and *.aspx files in the completion/custom folders are also skipped.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T09:35:11+00:00Added an answer on June 6, 2026 at 9:35 am

    The issue with this was… line breaks!
    Where I’d split each -skip directive to a new line that was causing the illegal characters in path. Running all the skip directives inline has solved this:

    <exec>
      <executable>$(MsDeploy)</executable>
      <baseDirectory>$(ProjectsDirectory)$(projectName)$(ProjectsWorkingDirectory)\Website\</baseDirectory>
      <buildArgs>-verb:sync 
                -source:contentPath="$(ProjectsDirectory)$(projectName)$(ProjectsWorkingDirectory)\Website\" 
                -dest:contentPath="C:\WWWRoot\$(websiteFolder)" -skip:Directory="assets" -skip:Directory="_TempImageFiles" -skip:objectName=dirPath,absolutePath="\\Desktop\\Docs"
      </buildArgs>          
      <buildTimeoutSeconds>600</buildTimeoutSeconds>
      <successExitCodes>0,1,2</successExitCodes>
    </exec>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Want to build up a csv file, call up the default email app and
want to know why String behaves like value type while using ==. String s1
I want to package my VS2010 web application project ready for deployment with msdeploy.
I'm trying to deploy an ASP.NET MVC 2 app using MsDeploy. I use VS2010
We have several web services that we have been deploying manually using msdeploy .
want to make a check in my installer before starting installation if any other
Want to attach an Event Handler/Listener to some links using the delegate() method, but
Want to populate dynamically combobox-listbox-drop-down using javascript. var table = document.createElement(table); var select =
Want to play a file that on path like this /var/spool/sound/dog.wav present on server.
I'm trying to drink the MSDeploy koolaid, but with little success. I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.