TFS 2012 : The working folder is already in use after Hard Disk Format - team-explorer

I have referred to a lot of forums and also this so question but my problem is that I have formatted my machine. So I'm not able to overcome this issue. I have tried deleting workspaces from visual studio command prompt and also clearing cache, but I feel this mapping is more on the server-side than local cache, because my machine was formatted. I don't know which file has this old working path saved.
Also I have tried downloading the project into a new working path. I was able to download, but then I don't get the TFS icon against each file. i.e.it's like working offline (disjoint from TFS database). On right click we generally have an option to return online or go online. In this case on right click I get TEAM -> Apply Patch & TEAM -> Share Project
Please help me with this.I had the same problem in my asp.net projects, when I simply downloaded them onto a new working path it worked fine. But this java project in eclipse just doesn't seem to connect to tfs when downloaded into a new path nor does it allow to download in the old path.
Please not I have formatted the machine.So my case is different, so this may not be a possible duplicate of other SO questions.
I did not disconnect or delete workspace before a format(due to lack of knowledge) at that point. May be doing that would never cause this.
All I did is check in all files and re-formatted my windows.

I'd suggest using the (free) tool TFS Sidekicks: http://www.attrice.info/cm/tfs/
This will give you a GUI to view all workspaces (across all users and machines), and delete the obsolete ones.

This is stored on the server, but the tf workspace command should be able to remove it for you. You will probably need to supply it with the correct machine name to find it:
tf workspaces /computer:* /owner:domain\jesse.houwing /collection:http://yourserver:8080/tfs/DefaultCollection
Find the missing workspace (the one that was formatted) and remove it from the server:
tf workspace /delete /collection:http://yourserver:8080/tfs/DefaultCollection workspaceName;domain\jesse.houwing
Do not confuse tf workspaces /remove and tf workspace /delete, the former only removes the registration from your machine, the second removes it from the server.
Or, if the computer name and the username have stayed the same, edit the workspace and delete the paths no longer valid (or update them to their new location) by changing the workspace configuration. Use
tf workspace workspaceName;Owner
to open the dialog to edit your current workspace.
Or use
tf workspaces /updateComputerName /updateUserName
To reassign the workspace from the old computer (iinstallation) or user to the new one.

I tried using the TFS sidekick tool, but even then, ran into access denied error. Then I had to manually clear off the files from this path:
C:\ProgramData\Microsoft Team Foundation Local Workspaces
So this can be alternative, if you do not want to install a tool or your company does not allow you to install software from unknown sources on your laptops due to policies.

This already has a marked answer but my problem was solved without command line or additional software.
I had just recently updated to '15 and I was migrating my workspace folder to another drive as it was getting too big. The error being uninformative as it was, still appeared even after I deleted the workspace it cited...or so i thought. Both VS'13 and '15 by default made the same named workspace but one for each version. I had to reopen '13, and delete that workspace then move back to '15 where it would now let me remap my folder.
Hope this helps someone.

logout from previous user and login by new user.
Copy Project Folder to Another path.
In team Explorer Right click on project and Remove mapping.
Remap Project

go to Control Panel --> User Accounts --> Manage your credentials --> Edit tfs User Name
user name : your TFS user.
I solved it like this.

I had the same problem.
TFS workspace manager throw me this error:
"The working folder \PATH\ is already in use by the workspace my_computer_name name_of_previous_user on computer my_computer_name"
I solved this problem by creating user in TFS server and deleting the previous one.
U can go to TEAM> TEAM PROJECT SETTINGS > SECURITY.
& if u have permission- create your own user.

This is what I did to get it to work using Manage Workspaces in VS:
Click on Show remote workspaces, delete remote workspaces as I was not using them anyway, not sure if this was needed.
Created a new Workspace B and mapped to another folder Y and choose yes to download all files now.
Deleted original workspace A, mapped to Folder X.
Recreate original workspace A and remap to folder Y (wrong folder) and choose Yes to download all files now.
Delete Workspace B
Edit Workspace A, go to Advanced. At the bottom where it says Wroking Folders, change the Local Folder path back to folder X and choose yes to download all files now.
Not sure if you have to do all those steps but that is what I did to finally get this remapped, only took all day.

Related

TFS Folder creation and update permissions set to readonly

Over the last several months myself and those on my development team have run across a new issue. When TFS creates a folder or does a 'Get latest' and overwrites any of the files in the folder structure, it changes the folder permissions to 'Read-only'. This causes an issue, an inconvenience really, where when we go to build the project it will tell us that our access to those folders is denied. If we open the folder and un-check 'Read-only' we are then able to proceed with the build and/or publish of the solution.
We have checked with our networking department, this is not a network setting and is not occurring anywhere outside of TFS. This is only occuring when TFS creates the folder.
Is anyone else having this issue? I've been pouring over settings off and on, trying to determine if I can change this setting. I do not want the folder to be read-only when it is generated or updated.
This is by design but your inconvenience is not. In TFS 2012 (with VS2012) Microsoft introduced local workspaces that do not put anything as readonly.
You can go to the settings of your workspace and change it from server to local any time.
You are also making a common mistake in that you have files that change during a build under source control. If you remove those files you will be able to build even with server workspace.
It is bag practice to put files that you generate under source control.

Computer renamed - TFS Workspace doesn't work now

Had to change my computername and domain. Now I can't access team foundation. I tried this statement to fix it.
tf workspaces /updateComputerName:MyOldComputerName /s:"http://MyServer/MyCollection"
It didn't work. I get the following error "Key not valid for use in specified state."
Not sure what to do now.
It sounds like you may have a problem that will prevent remapping the workspace. However, it's possible that the command isn't quite correctly formed, so try checking the collection URL (I'd expect it to include MyServer:8080), and in versions of TFS 2010 onwards the documentation refers to /collection: rather than /s:
If that fails, then one approach to rescue things is to create a new workspace and delete the old one. You can transfer any edited files you had checked out to the new workspace as follows:
Rename your old source code folder, so you keep a backup
Create a new workspace that maps the (old) source code folder location, and Get the latest version of the code.
If you think you deleted or added files, use a folder-diff utility to find them, and manually re-do those changes.
Now check out everything (right click on the root folder and check it out)
Copy your backed up source code over your workspace folder
Undo checkout on everything. Visual Studio will ask if you want to discard your changes. Carefully choose the "No to all" option. This means it will only discard locks on unchanged files.
You will now have all changed files listed in your pending changes.
Once you're absolutely sure this has all worked, you can delete your backup of the source.
(You can achieve a similar thing by unplugging your network cable to force Visual Studio to go offline, moving your old source code back in place of your new workspace folder, then plug the net cable back in and using File > Source Control > Go Online. This should diff your code to the server and work out what changed. I don't trust this as much as the above approach though)
Once you have the code in your new workspace, you can use the tf command to delete the old workspace to clean everything up.

How to remove a TFS Workspace Mapping?

I had a project in tfs within a team project then we moved the project to a different location in another team project.
I had configured Jenkins to connect to the team project and build my solution but when I changed the settings to connect to the new tfs team project, it gives me the below error:
[workspace] $ "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\tf.exe" workspace -new Hudson-ProjectName1-Build-MASTER;domain1\username1 -noprompt -server:http://domain-eg.net:8080/tfs/newteamproject ********
The path D:\jenkins\jobs\ProjectName1-Build\workspace is already mapped in workspace Hudson-ProjectName1-Build-MASTER [http://domain-eg.net:8080/tfs/oldteamproject].
So the above shows that there is an existing workspace so I ran the below command to remove it
tf workspace -delete Hudson-ProjectName1-Build-MASTER;domain1\username1 -noprompt -server:http://domain-eg.net:8080/tfs/oldteamproject
and it prompted that the workspace has been removed but I'm still getting the same error.
I also checked whether the mapping has been removed or not by running the below command:
tf workspace -server:http://domain-eg.net:8080/tfs/oldteamproject Hudson-ProjectName1-Build-MASTER
but it says the workspace doesn't exist as expected.
So, I thought it might be caching it somewhere and ran the below command:
tf workspaces /remove:* /collection:http://domain-eg.net:8080/tfs/oldteamproject
and it said "No workspace in the cache matches * from server http://domain-eg.net:8080/tfs/oldteamproject"
so I'd guess it's not even cached.
So what's causing the error and how to resolve it?
From VS:
Open Team Explorer
Click Source Control Explorer
In the nav bar of the tool window there is a drop down labeled "Workspaces".
Extend it and click on the "Workspaces..." option (yeah, a bit un-intuitive)
The "Manage Workspaces" window comes up. Click edit and you can add / remove / edit your workspace
From VS on a different machine
You don't need VS to be on the same machine as the enlistment as you can edit remote enlistments! In the dialog that comes up when you press the "Workspaces..." item there is a check box stating "Show Remote Workspaces" - just tick that and you'll get a list of all your enlistments:
From the command line
Call "tf workspace" from a developer command prompt. It will bring up the "Manage Workspaces" directly!
I ran into the same problem, and was able to fix it by manually deleting all the files in the TFS cache, located here:
%LocalAppData%\Microsoft\Team Foundation\3.0\Cache
or 4.0, 5.0, etc.
Follow these steps to remove mapping from TFS:
Open team explorer
Click Source Control
Right click on you project
Click on Remove Mapping
The error is genuine. You might have created workspace with same name on different machine. Now you may have changed machine having different machine name.
So here is work-around that will definitely work.Following is work-around.
Go to "Team-Explorer"
Go to "Source-Control"
Go to Workspace drop-down
Click on "Workspaces..."
A pop-up window will appear
Click on "Show remote workspaces"
Now delete the workspace which is conflicting and you can proceed your work.
Please follow the below steps:
Ctrl + Run
Copy and Past
%LocalAppData%\Microsoft\Team Foundation
You will get different version of TFS e.g
Click on each folder and you will get
Now Delete all data in these folder.
Reopen the Visual studio.
Thanks.
All of the answers here seem to be partial answers that don't work in all cases. I think this answer will work in all cases, assuming you have proper permissions.
Open up the Developer Command Prompt. In my case, I've tested this with the Developer Command Prompt for VS 2019.
Type this command: tf workspaces
Note that the results can list a couple tables with identical structure. If you only see one table, then some of the assumptions in the other answers can work for you. However, if you see two or more tables, then that Collection string is important! For our examples, we're going to assume you have two Collections (two is no different than four other than one is more tedious than the other to go through it):
https://dev.azure.com/foo and https://bar.visualstudio.com/
With luck, you will know which one of these two you want to work with. However, if you need to cycle through them all, then you'll just have to do that one collection at a time. Each "Collection" here is the same as an "Organization" in Azure DevOps (I think).
If you don't use this Collection detail, then you might see an error message:
Unable to determine the source control server.
Next, type this command for the collection you want to use:
tf workspaces /computer:* /owner:* /collection:https://dev.azure.com/foo
This will give you a much more complete picture of what you're dealing with. This gets especially nasty if you have had multiple MSAs and Org accounts hitting this repo from the same computer. In fact, you might have multiple seemingly-identical entries. If you try to delete them based on what you currently know, it may not work. But we can get more information.
Next, we're going to run the same command but append /format:xml to the end of it:
tf workspaces /computer:* /owner:* /collection:https://dev.azure.com/foo /format:xml
This now gives you a bunch of XML with some additional properties. The ones that we likely care about the most are the Owner Aliases. This is the missing information you need to now go through and delete these workspaces. Without this additional information, it's easy to hit a wall and be stuck with an error message:
Specify one workspace.
Now we have all of the info we need. Given the additional OwernAliases entries, select the unique entry (or repeat if more than one) that you wish to delete and use this following command (a couple examples are listed):
tf workspace /delete /collection:https://dev.azure.com/foo
"MyWorkspaceName;Windows Live ID\John.Doe#hotmail.com"
tf workspace /delete /collection:https://dev.azure.com/foo
"MyWorkspaceName;John Doe"
tf workspace
/delete /collection https://dev.azure.com/foo
"MyWorkspaceName;2C3E8474-A39C-4785-8794-DC72F09981E6\John.Doe#Example.com"
The GUID identifies an AAD directory and the quotes are there to handle any spaces that might be in an alias. The "MyWorkspaceName" comes from your previous queries listing out the workspaces.
Without this very thorough approach, it's possible that all of the other answers in this question will fail for you. While some of those efforts will clear out local workspaces, they will not clear out server workspaces, which you can still conflict with. Additionally, if you have previously used a different account things can get hairy, like if you switched from an MSA to an AAD account. And things get REALLY hairy if you have an MSA account and multiple AAD accounts all with the same email address that you have used from the same workstation. And then it gets super crazy hairy if multiple of those all used the default name for the workspace: your computer's hostname. In my case, I had four workspaces all with the same Workspace name, Owner name, and Computer name (i.e. the first query without the XML formatting had 4 identical records!).
I do not know if there's a more graphcial way to manage these than this. I have looked and not yet found a better way than this.
Update 2019-01-23
If you’re repeatedly getting the following error The workspace wkspaceEg does not exist… even after employing the correct username (wkspcOwnerDomain\wkspcOwnerUsername) in the tf workspace command, e.g.,
tf workspace "wkspaceEg;wkspcOwnerDomain\wkspcOwnerUsername" /collection:http://tfs.example.com:8080/tfs/collectionEg /login:TFSUsername,TFSPassword
then the tf workfold command may help fix it. See this question.
If even that doesn’t work and you’re unable/unwilling to use TFS Sidekicks, proceed to the risky last-ditch option below.
I’m using TFS 2012. I tried everything that was suggested online: deleted cache folder, used the workspaces dropdown, tf workspaces /remove:*, cleared credentials from Control Panel, IE, etc.
Nothing worked, I believe my workspace got corrupted somehow. Finally, I went to the TFS database and ran the following queries. That worked! Of course be very careful when messing with the database, take backups, etc.
The database is called Tfs_<<your_TFS_collection_name>>. Ignore the Tfs_Configuration MSSQL database. I'm not sure but if you don't have a Tfs_<<your_TFS_collection_name>> database, settings might be in the Tfs_DefaultCollection database. Mapping is stored in tbl_WorkingFolder.LocalItem.
/*Find correct workspace*/
SELECT WorkspaceId, *
FROM tbl_Workspace
ORDER BY WorkspaceName
/*View the existing mapping*/
SELECT LocalItem, *
FROM tbl_WorkingFolder
WHERE WorkspaceId = <<WorkspaceId from above>>
/*Update mapping*/
UPDATE tbl_WorkingFolder
SET LocalItem = 'D:\Legacy.00\TFS\Source\Workspaces\teamProjEg' WHERE
/*LocalItem = NULL might work too but I haven't tried it*/
WorkspaceId = <<WorkspaceId from above>>
Team Explorer > Source Control Explorer >
I managed to remove the mapping using the /newowner command as suggested here:
How can I regain access to my Team Foundation Server Workspace?
The command opened an Edit Workspace windows where I removed the mapping. Afterwards I deleted the workspace I didn't need.
None of the answers here removed my workspaces. But here is one solution that may work for you.
Open up a Visual Studio command prompt
Close Visual Studio first or the delete command may not delete the workspace
List the workspace commands -> tf /? to find the commands available to you from the version of TFS.
List the workspaces -> tf workspaces
Delete the workspace -> tf workspace YourWorkspace /delete
You don't have to delete the entire Cache folder. you lose all settings / preferences
The workspace mappings are stored in a file called:
VersionControl.config under the users local settings/application data directory.
located here in windows 7:
%LocalAppData%\Microsoft\Team Foundation\x.0\Cache\Volatile
where x= 3.0,4.0, 5.0,6.0 etc.
Inside this you will find guid named folders , open each of them, manually editing the forementioned file, to remove the workspace mapping(directory path will be present in mappedpaths attribute) from that local folder to the TFS server (which is no longer in usage).
File -> Source Control -> Advanced -> Workspaces -> Choose the workspace in Manage Workspaces and click "Edit" Then you can change the local folder.
Finally deleted ALL workspaces and started from scratch. Fixed.
I was prompted to login to our TFS server via Visual Studio, so I used my SU account which is typically required for server access. This led to some issues, and I ended up mapping to a different folder, not realizing I had just duplicated all my stuff. At some point, Visual Studio reverted back to my regular user, I "lost" pending changes, and noticed that new pending changes were placed by in my old mapping.
When I would try to remap to the new location (that the SU account was linked to) in an attempt to recover my pending changes, it would tell me it was already mapped to the SU, and I couldn't do that, but had no way of removing the map! Show remote workspaces, removing all workspaces via command line, etc revealed nothing. I then thought "what if it's actually linked to the SU user account on my computer, not the domain." I logged in as my SU locally, and sure enough, there was a workspace all setup for that user. I removed the mapping, and was able to go back to my regular user and remap without issue.
Moral of the story, perhaps another user is logged in on the same machine, which isn't visible from the currently logged in user, thus you cannot remove or even see the mappings.
If the mentioned clues are not helping you then download Team Foundation Sidekick and using that you can delete the workspaces.
Following are the steps to remove mapping of a project from TFS:
(1) Click on View Button.
(2) Open Team Explorer
(3) Click on Source Control
(4) Right click on your project/Directory
(5) Click on Remove Mapping
(6) Finally Delete the Project form local directory.
You can also remove a tfs mapping by simply editing your .sln file and removing the GlobalSection element for the tfs binding.
Thanks for your help!
Find problem workspace
SELECT * FROM tbl_Workspace
WHERE WorkspaceName like '%xxxxx%'
Find desired workspace
SELECT * FROM tbl_Workspace
WHERE WorkspaceName like '%zzzzz%'
Select Edit Top 200 tbl_WorkingFolder then Find the problem mapping
SELECT * FROM tbl_WorkingFolder WHERE WorkspaceId = Problem WorkspaceId from above
Change the WorkspaceId to the desired WorkspaceId
Finally goto Project Explorer and select Remove Mapping on the project
Modify VB6 MSSCCPRJ.SCC to match the desired WorkSpace
First download and install Team Explorer plugin in your system and then go to the Source Control Explorer. In the navigation pane find the Workspace field and click on Workspaces option.
After clicking on Workspaces option, you will see all the workspaces that are mapped. Click on the remove button and the remove the mapping for required workspaces.
Run tf workspaces to view current workspace mappings. Output looks like:
Then run tf workspace /delete "{workspace};{user}
Using output above, to delete workspace bi:
tf workspace /delete bi;James Wierzba
If mapping is proper then you can undo/checkin your changes, if you really want to change folder name.
Alternatively if you want to remove mapping then in Visual Studio go to
File-> Source Control-> Advanced-> Workspaces-> Edit
Now you can click on appropriate path and remove mapping.

The workspace version table contains an unknown schema version

Just started up Visual Studio 2012 and opened my solution which is in source control with Team Foundation Server 2012 Express and encountered this, any ideas? Can't get latest, can't check in, everything appears checked out :( Basically my workspace is unusable right now.
TF400018: The local version table for the local workspace MY-PC;My
User could not be opened. The workspace version table contains an
unknown schema version.
There is only one post I could find on the net, and the answers are pretty vague.
I had the same issue, and I just fixed it on mine.
If you don't mind re-map all your projects, you can try follow:
Click the box in "Workspace".
Click on "Workspaces".
Delete the workspace profile you're currently using
Re-connect to TFS open "Source Control"
Be aware that you may lose all your TFS mappings, you may need to re-map all your projects from TFS. Backup your changes that not checked in yet.
cycle6 is correct, but it isn't clear that you will not lose your pending check-in list if you follow some additional steps.
Click the box labelled "Workspace".
Click on "Workspaces".
Delete the corrupt workspace profile, accepting the warning.
Re-connect to TFS and open "Source Control Explorer"
Create a new workspace
One by one, map your projects to the same folder as before
You will be presented with a list of conflicts, where you have matching writable files in the folder already.
Choose "Keep local copy" for each file you had checked out before, and "Take Server Version" for any files changed by other members of the team that you didn't have the latest version for. This might take a while depending on the length of the list, but it is worth comparing versions for any file you are unsure of.
You will be left with your solution and all pending items marked as checked out, with your work preserved.
I did the following steps and it solved the issue:
deleted the hidden folder named $tfs and then
in the Visual Studio, Solution Explorer: Right click on the solution node > the Source Control > Get Specific version > latest version
If you already have multiple instances of Visual Studio open.
Close all of them . [in some cases you need to log out from windows & log back in OR restart ]
Rename the $tf folder with any other name (eg. $tft)
Start Visual Studio, to see your issue fixed. :)
Hope this helps.
Sometimes this happens when you are running out of disk space.
Try to see if you have very low space, eg. < 10 MB.
If that so, try to clean up your windows Temp folder. See if that solve this issue
It's a misleading message to an extent.
What has happened is that the internal data structures of the workspace have become corrupt.
The ends up as the code (in the tf command, Visual Studio, et al.) to load those data structures failing to load from the relevant files, which becomes an error about a schema version problem.
In the case that I experienced, this was because the machine hosting the workspace ran out of disc space while doing operations upon the workspace of various kinds (check-outs, check-ins, adding pending changes — it was actually a bunch of workspaces being used by TFS 2017 build agents and multiple active builds).
This corrupted parts of the data that are held in the files under the hidden $tf subdirectory (it always being a local workspace on a TFS 2017 build agent), because source control wasn't able to rewrite/extend these files.
Other answers here discuss partly retaining some of the files, based upon more specific knowledge of what has not been corrupted (such as preserving the internal files storing pending changes if one wasn't creating any pending changes), but the basic idea is that one needs to reset all of the stuff in $tf to a sane state of some kind.
In my case, I had the disadvantage of multiple potential causes and no consistent knowledge of which parts of $tf were corrupted, but I conversely had some advantages:
It being a TFS build, arranged to build from the build agent's s (source) directory into its a (artifact staging) and b (binaries) directories, there were not masses of non-source-controlled object and other files in the workspace (which is the s directory) that would have ended up as pending additions.
There were not any pending changes (to actual source files) worthwhile to preserve. I could afford to lose all information about source files, and indeed all current locally-stored information about the workspace, and simply run the build again with a fresh sane and largely unpopulated workspace. I did not even need to restore source files and directories for the whole workspace, as the first task in any TFS ("vNext") build is a "Get Sources" task that uses (variously) tf vc scorch, tf vc undo, and tf vc get to check out the right source version.
So simply, in Developer PowerShell (Visual Studio being installed on the build machine):
Remove-Item -Recurse -Force 'X:\Agents\07\_work\1138\s'
tf vc get 'X:\Agents\07\_work\1138\s'
(Note that one can always get at the tf command in some way on a TFS build machine. Every build agent has a local helper copy of tf.exe and its ancillary DLLs in its VSTS "OM" subdirectory.)
I possibly could have omitted the tf vc get step, but having had trouble with "Get Sources" in the past I do not trust it to robustly cope with arbitrary manual external alterations, such as no s directory when the build isn't configured to outright delete that entire directory itself (as it can be but was not here).
For the same reason, Microsoft's own "agent maintenance" (another way to clean things up) is quite dodgy, and ends up leaking workspaces on the TFS server (which I have raised a bug with Microsoft about).
There is simple workaround. Remove local mapping to folder where is the sources (Advanced -> Remove Mapping, or just rename or delete mapped folder. After that you will be able to connect to tfs. Download the project again.
If you already have multiple tfs instances of Visual Studio open.
1.) Open File -> Source Control -> Manage Workspaces
2.) Delete all tfs map
3.) Then select folder maps
For the same issue in eclipse: Find the folder $tf and delete it.
You will find the $tf folder in the workspace directory. If not then search for the $tf folder.
Once you have found it, delete it.
In my case, none of the other answers helped - the problem was occurring on a machine that didn't have Visual Studio and no matter how I tried to get rid of the bad workspace data it never worked. After working with procmon a bit, I discovered another critical folder that might be the source of this error: C:\Users\All Users\Microsoft Team Foundation Local Workspaces\ (it might also be under C:\ProgramData (on my system, 'All Users' is a symlink to that folder, but not sure if this is typical.) In this folder there are sub-folders named like guids that contain some other folders, one per workspace it appears. In my case, some of the data in these folders was old and some was corrupt. Once I deleted the bad workspace folders, all my problems disappeared. You might also want to delete the Cache folder as identified in the comments of this post, but that didn't help me (didn't seem to hurt though, either.)
Alternatively, you could just backup your current workspace to a different location, re-create your workspace, and copy the files back that you had made changed to. VS should detect the newest files and automatically check out these files allowing you to check in the newer versions that you copied back from your backup.
What worked for me is, delete the local folder(s), restart your machine, then map the projects again. Any pending changes you have just save them somewhere else temporarily.

Latest value = "Not Downloaded"

I have several projects in TFS which visually appear in the directory hierarchy as grayed out. When I browse within the projects in Visual Studio 2010/Source Control/TFS 2010, I notice that all of their contents have a Latest value of "Not downloaded". Normally, I have only seen Latest values of "Yes" or "No".
I have tried all of the varieties of "Get latest" that I know, but I am always alerted that "All files are up to date".
If I try to "Check out for edit", I am not allowed.
When I observe the properties of these grayed out files, they always say Workspace Version = "Not applicable".
How do I fix TFS so that I can download and check out the projects again? My suspicion is that my workspace is messed up, but I do not know what to do to restore/reconfigure it.
I was able to remap the directory to fix my issue. To do this, I
selected (right-clicked) the branch that included all of my code, and selected "Remove Mapping..."
renamed the folder I was mapped to within TFS (you can delete it as well, but I renamed just to keep it during this experimental process)
created a new folder with the original name of the branch I was mapped to in the beginning, and
selected (right-clicked) the branch that included all of my code, and selected "Map to Local Folder".
This process forces a complete re-download of the entire branch. Luckily for me, my branch was only 2GB, so I was able to re-download in about 5-10 minutes.
The reason for getting "All files are up to date" - is that the information on the TFS server and the files on your disk is out of sync. If you delete the files on your disk with file explorer - the TFS server still thinks you have the file on disk. To re-sync you have to force an update like this:
Check the two checkbox on this dialog - and click Get:
It happened to me as well when I added and existing project as a reference to another project.
When I added the project reference I had a pop-up message that told me that the current project already exists at the source control but at a different location then the relative path of the current project.
by a mistake I choose the wrong option which lead to the unnecessary mapping.
In order to solve this issue I've removed the mapping from the workspace.
only after removing the mapping i could get the latest project.
I solved it by following this - remove the work space and then tfs prompted me to download everything again.
https://msdn.microsoft.com/en-us/library/ms181386(v=vs.100).aspx
It sounds like the folders / files in TFS are not mapped to a local drive in your workspace.
In Source Control Explorer, select the "Workspace:" dropdown, then select "Workspaces".
Choose your current workspace form the list that appears, then hit "Edit". Check that the TFS folder $/blah is mapped to a local folder c:\tfs\blah
You should now be able to get latest, check out etc.
I had some weirdness with this after :
updating to TFS2017
updating to VS2017
trying to change my TFS URL to https (gave up and reverted back to http)
So somewhere along the line this broke my workspace such that all my projects were showing as unbound. I was able to do a get latest again. This should not overwrite any files you have changed providing they are writable, but if you have any doubt whatsoever then backup your local workspace before doing get latest. It will ask you to resolve conflicts - so make sure to select 'keep local copy'.
In my case, when the branch was deleted: Right click + Check in, helped.

Resources