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

  • Home
  • SEARCH
  • 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 6238073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:08:46+00:00 2026-05-24T11:08:46+00:00

When using msdeploy to do a sync operation, one of the things that MSDeploy

  • 0

When using msdeploy to do a sync operation, one of the things that MSDeploy checks to determine if a file should be synced or not is the attributes on the file (readonly, archive, etc.). If the attributes are different between the two copies of the file, then the file will be synced. Is there a way to tell MSDeploy to ignore file attributes when determining if a file should be synced or not?

  • 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-05-24T11:08:47+00:00Added an answer on May 24, 2026 at 11:08 am

    It is possible, however, not merely on the command line. You’d have to build a custom DeploymentRuleHandler, like this:

    namespace CustomRuleHandlers
    {
        using Microsoft.Web.Deployment;
    
        [DeploymentRuleHandler]
        internal class IgnoreFileAttributesRuleHandler : DeploymentRuleHandler
        {
            public override int CompareAttribute(DeploymentSyncContext syncContext, DeploymentObject destinationObject, DeploymentObjectAttribute destinationAttribute, DeploymentObject sourceObject, DeploymentObjectAttribute sourceAttribute, int currentComparison)
            {
                if ((destinationObject.Name.Equals("filePath", StringComparison.Ordinal)) 
                    && destinationAttribute.Name.Equals("attributes", StringComparison.Ordinal))
                {
                    return 0;
                }
                return currentComparison;
            }
    
            public override string Description
            {
                get { return "Ignores file attributes when determining if a file should be synched or not."; }
            }
    
            public override string FriendlyName
            {
                get { return "IgnoreFileAttributes"; }
            }
    
            public override string Name
            {
                get { return "IgnoreFileAttributes"; }
            }
    
            public override bool EnabledByDefault
            {
                get { return false; }
            }
        }
    
    }
    

    Compile that into an assembly (targeting .Net 3.5 for WebDeploy v2!) and put the assembly into the “Extensibility” subfolder in the WebDeploy folder (normally, C:\Program Files\IIS\Microsoft Web Deploy V2\Extensibility).

    Then, you can easily leverage your custom rule when running msdeploy from the command-line by adding this argument:

    -enableRule:IgnoreFileAttributes
    

    Of course, that assembly needs to be present on both, the source and the target machine, of a sync operation.

    Unfortunately, there’s no easier way of getting there!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using TortoiseSVN against VisualSVN I delete a source file that I should not have
using CodeIgniter normally one has to specify the controllers in the config/routes.php file. This
using ASP.NET MVC, I have a Model, to which I'm attaching attributes so that
Using javascript, one of the things I need to do is when a button
Using ASP.NET MVC there are situations (such as form submission) that may require a
Using C#, I need a class called User that has a username, password, active
I am using msdeploy to transfer my changes(via a nant script in Team City)
We're using msdeploy to deploy our sites to various environments from our continuous integration
I'm trying to deploy an ASP.NET MVC 2 app using MsDeploy. I use VS2010
I'm using a staging model with MSDeploy to deploy a couple of our sites

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.