Getting "Failed to create mapping" when adding a solution to TFS source control

Tfs

Tfs Problem Overview


I've created a new Team Project in TFS, but when I try to add my solution to it I get:

'Failed to create mapping

Cannot map server path, $/Finance/MyApp, because it is not rooted beneath a team project.'

I can't find anything on google or here that looks remotely like this problem.

Tfs Solutions


Solution 1 - Tfs

I had this issue when using Microsoft's Team Foundation Service from Visual Studio 2012. I had just created the new team project via the TFS website. Although I could see my new project in the 'add solution' window, I got the error the OP reported.

I had to go into the "Team Explorer" window, then into "Connect to Team Projects" and tick the new project. Then I was able to add my solution to the team project.

Solution 2 - Tfs

Is Finance a team project for you?

If not, you can clear the mappings for the workspace or even just delete your workspace. http://msdn.microsoft.com/en-us/library/54dkh0y3(v=VS.100).aspx

Solution 3 - Tfs

Had the same issue when upgrading project to TFS 2010 from 2008. The solution was to delete the vsssc file in the root of the project folder and re-add it

Solution 4 - Tfs

In my case I had to do Team Explorer and connect to the new project then I had to close my solution and re-open and then the "add to source control" worked.

--Connect and check project in team explorer window --Close solution --Open solution --retry adding solution to source control

Solution 5 - Tfs

I had this issue with Visual Studio Online's source control, Visual Studio would not recognize the team project even after connecting to team projects, refreshing, restarting Visual Studio. I had to use the "Open in Visual Studio" link from the project on the Visual Studio Online site and then open the solution from there.

Solution 6 - Tfs

Well, i didn't want to do anything so drastic, it turned out that one of my subfolders inside the solution i wanted to add to source control, was mapped inside a different workspace (on a different TFS server). So the solution was to connect to that other TFS server, find and delete the conflicting folder mapping inside that workspace, and try again.

Solution 7 - Tfs

I had the same problem using visual studio 2008 and TFS 2012. In my case, when I manually added the local folder to the project through the workspace mapping, the problem went away.

File -> Source Control -> WorkSpaces -> Edit

Then when I went to add the solution to source control it detected the mapping automatically.

Solution 8 - Tfs

In my case, I copied the folder from "My Documents" to c:\tfsroot where I had mapped the TFS Root. Then when I opened the solution and added it to TFS it worked.

Solution 9 - Tfs

I had the same problem. My solution in VS2017:

  • Open Team Explorer tab
  • Select Source Control Explorer
  • Right click on the top level folder for the project and select "Advanced/Remove Mapping"
  • Remove the Mapping
  • Right click on the top level folder for the project and select "Advanced/Map to Local Folder"
  • Browse to the top level folder with the source code (You may need to adjust the path you selected. It may append a folder name to the end)
  • Click "Map"
  • Answer "Yes" to Message Box "Newly mapped items will not be downloaded until you execute a get. Do you want to get $/YourFolderName now?"

That should do it!

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionChris SurfleetView Question on Stackoverflow
Solution 1 - TfsDazView Answer on Stackoverflow
Solution 2 - TfsEwald HofmanView Answer on Stackoverflow
Solution 3 - TfsTjaartView Answer on Stackoverflow
Solution 4 - TfsOmgee CaresView Answer on Stackoverflow
Solution 5 - TfskilkfoeView Answer on Stackoverflow
Solution 6 - TfsBruno AltinetView Answer on Stackoverflow
Solution 7 - TfsMansfieldView Answer on Stackoverflow
Solution 8 - TfsTom ResingView Answer on Stackoverflow
Solution 9 - TfsKenView Answer on Stackoverflow