Files missing from TFS restore - visual-studio

I've just created the simplest little project with a Program.cs file, checked it in to Visual Studio Online, deleted the project locally, and then tried to get the latest version from the online repository. The program file didn't download, even though Source Control Explorer shows it on the server:
Any idea why this won't download?

At this point there are no changes in the files since you last did a Get-latest to your workspace. Follow the below steps to get the files for your workspace:
Right click on the file/folder
Choose Advanced instead of Get Latest Version
Choose Get Specific Version
Check the "Overwrite all files even if the local version matches the specified version" box
This will force a download of all the files and not just files that have changed since the last time they were retrieved to your workspace.

Related

how to stop ".jfm file cannot be accessed" from locking up tfs

I'm working on a project with a large solution in TFS, which includes a sqlProject. There's a few things we use in that project but there's also a .jfm file generated for the project. The .jfm has been excluded from the project but TFS keeps trying to access it. It also shows up under "Excluded Changes" even though I have not made any changes to it.
I've added a .tfignore file with the line
*.jfm
and restarted visual studio and rebooted my computer. This popup persists:
and then I can't open anything in Source Control Explorer, it just keeps giving me the popup. I've googled, spoken to my coworkers, tried moving the .tfignore file around, none of it has worked and it's driving me bonkers.
To ignore the .jfm files you have to ensure that the .tfignore file was checked in to the remote server.
Please try following below steps to fix this issue.:
Delete the .jfm files from TFS via web portal (backup them if needed),
Restart VS, Right click the project node under the collection and
select Get Latest Version to remove the .jfm files from local
workspace.
Set the .tfignore file and check in to the remote server
Then try it again, if that not work, just try to add a new workspace and map the sources in VS,then check in the .tfignore file to the remote server.

File gets excluded every time the latest code is taken from TFS

Let's understand the problem:
For our ASP.NET project using Visual Studio 2013 premium on a Windows 7 x64
On developer A's machine:
We've got a TFS setup
We added a new file A in the project
We checked-in the newly created file in the TFS source control
On developer B's machine:
We've got the same TFS setup
We forcefully took the latest (by specific option - overwrite option) version
File A gets loaded in the project, however it stays excluded
Developer B manually includes the file in the project
The files are well included and that is our concern. Why files which're included are getting excluded on other devs' machines?
The newly added files gets loaded on dev B's machine however they doesn't show up in the solution tree. We've to manually include them in the project after show all files
There's only one mapping on each dev's machine. The code is going to locally mapped workspace only
We've a little big team, so for every developer. It happens every time we take the latest version.
How do we suppress this behaviour? Is there a setting as such?
We've tried searching the web, couldn't find a solution.
It seems TFS automatically excluded the changes. You may encounter such a situation as below:
They're not loaded in your current solution, so Team Explorer assumes they're made as part of either a different solution and
that you don't want to check them in together with the changes that
do match the context you're in.
They're made in a different workspace, again Team explorer assumes you want to check in groups of files that logically make sense.
More detail info please refer the very detailed answer from jessehouwing in this question What are "Excluded Changes" in Team Foundation Server?
And if you are working with a little big team, the way you are using to "forcefully" take latest is not a recommend solution. Suggest you to still use get latest to download the files on the TFS server. Even though you may not obtain the "really latest version" of the file. You can still work on it and figure out the conflicts if there are during the check in action.
Update
If develop A has checked in the files, but not checked in the project file( .csproj file), then TFS will not download them if you execute a "Get Latest" by right clicking on the project or solution in Solution Explorer.
You will however get the files downloaded correctly if you right click and "Get Latest" on the folder in the source control window. But, they won't get loaded into your solution, because you haven't told TFS that they belong there.

Visual Studio Team Services (TFS online) - Get latest over two PCs with same account (VS2015)

My issue is that Get Latest (TFS) does not work using the same account over two PC's for a newly created file. Steps to reproduce:
On my main PC I opened Visual Studio 2015 (CE).
I created a new typescript (.ts) file.
I checked this new ts file in.
I go to work on my laptop and open VS2015 (using my same Microsoft Live account) and the new files do not download when I go to Get Latest.
If I traverse the files to see what was checked in on the server, they have been checked in successfully.
Exploring the files via VS2015 through the team explorer I see the files, they are indicated as not having downloaded and also is indicate "latest" as "no".
It would seem that my laptop is telling VS online that no changes to this file have been made (well in fact I cannot download the file to my laptop and is not present on my laptop so technically true - its hasn't changed because I can't download it to change it).
How do I tell VS online that my laptop is not my main pc while still using the same account to login? Or am I missing something? I've not used TFS an awful lot.
I'm fully updated. I did some folder re-naming so possible it's a bug to do with that.
I can not reproduce this issue via the steps you provided. The file can be downloaded successfully on both PC with same account. Since you mentioned that you did some folder renaming, so you need to check if your local workspace mapping is still correct. An quick way to fix this is creating a new workspace for the project. This will get all the latest files on Version Control.
There are several ways to get the latest version:
Get the latest version from "Solution Explorer" by :right click on the project/solution file -> source control -> get latest version. This only updates all the files related to the project/solution to the latest version. For example, you have ProjectA and ProjectB in the solution, and you right click on ProjectA to get the latest version, the files listed under ProjectA in solution explorer will be updated/downloaded. Other files won't be updated.
Get the latest version from "Source Control Explorer" by :right click on the folder -> Get latest version. This will update all the files under the folder.

I deleted my working copy but TFS thinks I've still got it

I deleted a local copy of a TFS source-code branch (actually I renamed the branch and had to delete the old-named version), but Source Control Explorer window in Visual Studio says I still have the latest version so whenever I double-click a file, I get an error that the file doesn't exist.
Is TFS supposed to notice when I delete a local working copy i.e. this is a glitch?
How can I address it? Get the latest version and then delete it?
Is TFS supposed to notice when I delete a local working copy...?
No. TFS TFVC expects that it controls your working directories, at least with a Server Workspace. When you start doing things without telling it, then it has no idea.
If you want to remove files from your local drive, do a get of changeset 0 on that path (where the files won't be) and/or delete your working folder mapping or delete the TFS workspace.
Why does it work this way? Performance. If you have 10+ GB of sources, you can't afford to have your version control system scanning your filesystem to try to figure out what you've done. That's why TFVC Server Workspaces work this way.
Change your workspace to a Local Workspace if you have only a small bit of source code and you want to scan the filesystem for changes. Or switch to Git in TFS if you want a complete distributed experience.

Retrieving file from source control?

Hi guys when I open my solution from source control(TFS 2013) in the morning some folders in a class library project does not load but they are in the windows explorer so I had to "Include in project" the folder after showing all files in the solution explorer but there are no contents even though i "Get Lastest(Recursive)" but I checked the web(Tfs) in the code -> explorer there are files shown in the tree view. Is there a problem with tfs? or visual studio? or both? what can I do to resolve this?
Looks like you have files checked-in TFS but your project file in TFS doesn't have those files included. Also, when you get latest from TFS looks like you override the local changes.
I have three(ish) suggestions:
You have the directory with the included files mapped to a different place on your local drive. You can check this my looking at your workspace mappings (File -> Source Control -> Advanced -> Workspaces). If you have more than one workspace then make sure you're using the right one.
You can force TFS to download files that it believes it has already downloaded. Instead of GetLatest, choose Get Specific version (this may be on the same menu or under Advanced - can't remember for 2010). Check Overwright writeable and all files and select Get.
Install TFS Power tools and try adding the files that way (i.e. through windows explorer)
This isn't really a suggestion, as I don't believe it will work, but if the above don't, try it. As above, select get Specific version, but instead of Latest version, select Changeset and choose changeset 1. THIS WILL DELETE ALL FILES IN YOUR WORKSPACE. The do a get latest as normal.
HTH

Resources