Getting "Failed to create mapping" when adding a solution to TFS source control
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/M开发者_C百科yApp, because it is not rooted beneath a team project.'
I can't find anything on google or here that looks remotely like this problem.
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.
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
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
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
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.
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.
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.
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.
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!
精彩评论