Error fix for "Add project to TFS Error. Map local path to server path: failed to create session" .
Root Cause: The issue is caused by having the Studio Workspace modified to be a Local one instead of a Server one.
Resolution:
- Open Visual Studio--> Source Control Explorer--> Workspaces--> Edit the workspace showing there and then Advanced.
- Change the Location from Local to Server.
- Restart Studio and click + Add to Source Control, Connect to Azure DevOps, Team Project and search the folder, worked perfectly.
- TFS works in Server Workspaces, instead of Local.
Note: Studio only works with Server Workspaces and it creates a Server workspace with the name {PC_NAME}_{USER_NAME}. If this specific workspace is modified using for example the Source Control Explorer tool integrated into Visual Studio to a Local one, Studio will not connect.
Projects cannot be opened from TFS if the workspace created by Studio is changed to a Local workspace from outside of Studio.