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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:08:49+00:00 2026-05-30T07:08:49+00:00

As part of a bigger implementation, I’m trying to implement a merge operation of

  • 0

As part of a bigger implementation, I’m trying to implement a merge operation of my source control branches/folders using TFS-SDK. I’m working against a TFS2010 installation.
What I have is this:

using System;
using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.VersionControl.Client;
using Microsoft.TeamFoundation.VersionControl.Common;

namespace MergeBranchesFolders
{
    class Program
    {
        static void Main()
        {
            TfsTeamProjectCollection teamProjectCollection = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri("http://TFSSERVER/Collection"));
            var versionControl = teamProjectCollection.GetService<VersionControlServer>();

            const string fromPath = "$/TeamProject/SourceDir";
            const string toPath = "$/TeamProject/TargetDir";

            Workspace myWorkspace = versionControl.GetWorkspace("WorkspaceName", "WorkspaceOwner");
            GetStatus getStatus = myWorkspace.Merge(fromPath, toPath, VersionSpec.Latest, VersionSpec.Latest,
                                                    LockLevel.None, RecursionType.Full, MergeOptionsEx.None);
        }
    }
}

I’m convinced that I get proper access to myWorkspace, yet the getStatus looks like this:

enter image description here
That pretty much says that nothing has happened.

Yet if I try to merge in the IDE, I get several merge candidates.
The same merge candidates are also visible if I do a:

var mergeCandidates = versionControl.GetMergeCandidates(fromPath, toPath,RecursionType.Full).ToList();

I failed with both fromPath/toPath being branches and folders – even with single file.
The only resource out there I could find was this one, which didn’t help…

  • 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-30T07:08:51+00:00Added an answer on May 30, 2026 at 7:08 am

    Shai Raiten’s blog-post to the rescue!

    This failed:

    GetStatus getStatus = myWorkspace.Merge(fromPath, toPath, VersionSpec.Latest, VersionSpec.Latest,
                                                        LockLevel.None, RecursionType.Full, MergeOptionsEx.None);
    

    This succeeded:

    GetStatus getStatus = myWorkspace.Merge(fromPath, toPath, null, null, LockLevel.None, RecursionType.Full, MergeOptionsEx.None);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a few issues with the following php functions (part of a bigger
Part I I am working on a web application that instead of using a
I am using JavaScript and trying to make a skew effect on a div.
I copied a part of a bigger project i'm working on, I didn't wrote
I'm trying to implement a linked list abstraction, however I am running into problems.
I'm trying to divide long text in small parts, so that every part is
I am trying to implement an inner class that has a generic parameterized type.
This is part of a bigger code, I keep getting the parse error :::
This is part of a bigger problem, but I'm having some problems with this
My ASP.NET MVC application is a small part of a bigger ColdFusion app that

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.