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 6673217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:36:06+00:00 2026-05-26T03:36:06+00:00

I am using the Microsoft Sync Framework and C# to develop the following function

  • 0

I am using the Microsoft Sync Framework and C# to develop the following function for syncing files between two directories:

    private void InitialSync()
    {
        var sourceId = new SyncId(Guid.NewGuid());
        var destId = new SyncId(Guid.NewGuid());
        var sourceReplica = new FileSyncProvider(sourceId.GetGuidId(), _firstPath);
        var destReplica = new FileSyncProvider(destId.GetGuidId(), _secondPath);
        var agent = new SyncOrchestrator
                        {
                            LocalProvider = sourceReplica,
                            RemoteProvider = destReplica,
                            Direction = SyncDirectionOrder.UploadAndDownload
                        };

        agent.Synchronize();
    }

This code works just fine. The problem is, it will sync not only files that have changed, but also it will sync files that are added to either directory and files that are deleted from either directory. Is there a way to make the agent.Synchronize(); ONLY sync files that have been changed and NOT sync files added or deleted?

  • 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-26T03:36:06+00:00Added an answer on May 26, 2026 at 3:36 am

    You will need to hook into the ApplyingChange event.

    This gets called before the change is applied so gives you a chance to overwrite the default behaviour.

    To skip a change, set the SkipChange property to true. A change that is skipped will not be applied to the destination replica. A SkippedChange event will be fired with SkippedChangeEventArgs.SkipReason set to ApplicationRequest for each change that is skipped.

    So if the ApplyingChangeEventArgs.ChangeType is Create or Delete then set the ApplyingChangeEventArgs.SkipChange to true. Then the only those files that are renamed or updated will be synced.

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

Sidebar

Related Questions

I'm using the Microsoft Sync Framework to sync files using the FileSyncProvider . One
I'm using Microsoft Sync framework 1.0 (without ADO.NET services) I have created 2 custom
I have the option of either using WCF or Microsoft Sync Framework for my
Using Microsoft SQL Server's database mirroring capability, can the mirroring occur between two clusters?
I am using Microsoft Access 2007 to move and massage some data between two
I have already setup syncing with Microsoft Sync Framework, and now I need to
I'm currently using Microsoft Sync Framework and everything is working fine except the SQL
I'm using the Microsoft Sync Framework to synchronize a SQL Server database with a
Does Microsoft Sync Framework 2.1 support this scenario? I'm using ASP.NET 3.5 and Sql
We're having an issue when using the Microsoft Sync Framework to sync tables and

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.