Visual Studio: Cannot add project to source control; it overlaps a project that is already bound to source control at a lower root

I’ve been getting this error a bit lately as I trying to add new projects to the solution, and then add them to source control:

The project <ProjectName> cannot be added to source control. In folder <SolutionDir>, it overlaps a project that is already bound to source control at a lower root. To avoid this problem, add the project from a location below the binding root of the other source controlled projects in the solution.

The cause of this was that I had linked files within the new project that were pointing to existing files higher up in the solution folder (in this instance, in the solution root).

In this case I was linking to the strong name key from the solution root:

<SolutionRoot>\MyKey.snk
<SolutionRoot>\MyProject\MyProject.csproj <= Was linking to the key in the root

To add the project to source control, you have to remove these links first, add the project to source control, then you can put your links back in.

3 comments to Visual Studio: Cannot add project to source control; it overlaps a project that is already bound to source control at a lower root

  • Thanks for posting the explanation. I’m at the end of a project right now and every little annoyance (like confusing error messages) is setting my teeth on edge.

    It’s nice to find a short useful answer.

  • Jay

    That is a useful article … an hour wasted trying to figure why VS.NET does not want to add the newly created project. In the new project I had a linked file to the assembly file in the root folder which created the same issue.
    Thanks

  • Willie Geoghegan

    Thanks for nice tip. I just used it to fix a project that I was trying to add Perforce SCM via Visual Studio. In my case I was sharing source files between a .NET class library project and a Silverlight version of the class library project.

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>