How can I get all the files - tfs

I have a solution. I select get the latest, it does not....
I have a folder that has 3rd party dlls. These are not gotten. Instead I have to go into my source control browser and get the latest. Programmers forget to do this and their code breaks.
How can I get the latest directly from the solution?

The source control interface in the solution explorer is very poor. I'd recommend using the source control view instead.
The reason that tfs doesn't get all the files when you get latest on the solution explorer is that it only considers files in the solution. If you use the source control view instead, you will get all the files with no messing about.
The other option is to add all the files to your solution. Right click in the solution explorer and add existing file. In the file browser, choose the file and then click the arrow at the right end of the open button to drop down a menu - choose add as link so that the solution references the file where it is rather than taking a copy of it.

You can use "Get Specific Version" and specify "Latest". Also specify to overwrite files that haven't changed.

Perhaps you could add the DLLs directly to the solution in their own solution folder. Then Visual Studio would know about them and pick them up with the rest of the solution.

Related

How to check in mass changes into TFS

I have a situation where a developer made mass changes to a project outside of TFS (long story), and now we want to put those changes back into TFS (files added, removed, renamed).
Of course, TFS is not like Git; if I check out the project, then delete the files from the workspace and copy over the new files, TFS won't adapt to those changes.
I have discovered that I can do a Compare from File - Source Control, and that the Compare screen allows me to mark files as added/deleted. This helps, but is a slow process for a large project, and quite prone to human error.
So, my question is: Is there an automated way to get TFS to simply add all new files and remove all deleted ones?
I don't care about tracking history of renamed files--they can be
considered "removes" and "adds."
I have tried unbinding and rebinding the workspace; this did not work for me (or I didn't do it correctly).
I am using VS 2015, TFS 2015, and I have the TFS Power Tools.
If you are using a Local Workspace then you should be able to get latest on the workspace, then copy over all the new files in Windows Explorer which will generate pending changes and file adds.
If you go into Pending Changes in Team Explorer you will have lots of detected changes for new files etc. but you can promote them to included changes.
This isn't going to deal with file renames or deletions though so it might not be the best solution.
Alternatively you could use Reconcile Changes in Version Control
In Source Control Explorer, right-click a folder, and then click Compare.
In the Compare dialog box. select the folder versions to compare.
In the Folder Difference window, right-click the folder or file you want to reconcile, and click Reconcile.
This will allow you to choose what to add or change to version control
You might try using tfpt online. I would add the /adds /deletes /diff /recursive flags as well.
I think in almost any case you will have some conflicts/manual work to do here.
There is a blog post on a possibly similar situation that used tfpt online as well: Discover File Changes Made Outside of Visual Studio
Since I did not get to try the above suggestions, I'll post the workaround I did, in case it helps anybody else. Hopefully, the above suggestions are better than what I ended up doing.
Make sure nothing is checked out
Open solution
Team - Go Offline
Close solution
Windows Explorer - Copy latest source folder into the current source folder (Windows Explorer will do a Merge).
VS - Open solutin, select solution file
File - Source Control - Advanced - Change Source Control
if you get a message about unloaded projects, make sure all projects loaded. Click "Reload" on those that didn't.
Shift to select all project, click Bind
Do a Compare in Source Control Explorer. Manually add all new files. Manually delete all deleted files. Frown.

Manually update files

Scenario:
A solution is checked into TFS. Changes are made to an offline/disconnected/unbound copy of the solution, which becomes "the latest" version. I want to update the repo with this disconnected copy's files.
How do I get TFS to look at all the files and determine which ones have changed, so it can check only those in?
If this were SVN, I would just plop the files on top of the existing working copy, and it would just work.
Do you have another copy of the solution that is bound to TFS? If not, you'll need one. You have two options:
Take the solution "offline" by right-clicking on the solution node and click "Go Offline". You can then copy your changed solution on top of the bound solution. When you load the solution again, right-click the solution again and choose Go Online. This will scan the disk and determine what has changed.
You other options is to run "tf edit" recursively on a bound solution, copy your changed solution on top of the bound one and then run "tfpt uu". "uu" stands for undo unchanged and it will undo changes to the files that are not different.
I cant think of any elegant way off hand but your best option would be to know what files were changed or added offline and connect them to the TFS version while removing the old TFS files.
To do this simply right click all of the old files and either delete them or exclude them from the project then move the new files into their physical folders and replace them with the updated version. If files were added then add them in the correct folders. Finally make sure all files are view-able in the solution explorer by clicking "show all files". Finally, right click the files you changed and select include in project for each.
This way you will have replaced only the files that were changed and won't have to check in the entire solution to TFS making it very unclear what files were changed with your check-in.

Exclude from project, source control issue

I'm using team foundation server 2010 # work and home.
I want to exclude some element from the project build but still have them exist in Team Foundation Server 2010 source control. How do I achieve this?
Exclude From Project will delete the item.
Same problem here, only way to do this is manually edit project file :(
Please vote that this bug is important to fix
https://connect.microsoft.com/VisualStudio/feedback/details/573582/vs-2010-exclude-from-project-deleting-files-from-source-control
Workaround posted on Connect:
Open the csproj file in notepad and find the files that need to be
excluded and remove or comment the compile element for that file, and
any related designer and resx files.
Editing a project file and removing the references to the files you want to exclude would be the easiest solution.
Another solution would be to remove files from the project via UI, but only checkin changes in the project file and undo the delete operations.
In the future you can add files directly to the TFS folder in Team Explorer.
May I ask: why would you want to do that? As I commonly have a problem of files which are not bound to any project and have to be getted manually.
I work in a TFS environment, and if it were me? I'd just change the name of the file (instead of excluding it from the project), and check that in instead. Since your project is expecting that particular filename...it won't find it. We use this when we're developing prototypes or holding on to antiquated code for documentation purposes. Sorry VS is eating your stuff!
Kind Regards,
-sf
I think these steps should help you do what you are looking for.
To exclude an item from a deployment project:
In Solution Explorer, select the file you want to exclude.
On the Solution Explorer toolbar, select Properties.
In the Properties window, set the Exclude property to True.
And this page explains the actions for project files supported by VS 2010:
http://msdn.microsoft.com/en-us/library/0ebzhwsk.aspx
--- Edit ---
At work I tried 'Exclude From Project' in one of the files of a project we have in VS 2010, which is bound to a TFS 2010 server, and this action did not delete the item from TFS; the Source Control Explorer window shows the red delete mark next to the item, and the 'Pending Change' column says delete, but item is there. Right click the item in the Source Control Explorer window, one of the commands in the context menu that pops-up is 'Check In Pending changes' and another one is 'Shelve Pending changes'. Shelving enables you to set aside the pending changes.
The file is still in the local hard drive. If I do 'Include In Project' the item comes back to normal.

Using TFS source control - how to remove files

I am a lone developer, and I am now using TFS 2010, having until recently used VSS.
I have not found it easy to get any books for beginners to help me use this.
So I have now got my project in source control. But when I check in I get references to a number of files that I no longer use. How do I remove files from the TFS Source Control repository?
So in the example below, you can see lots of files from different projects that I do not want to see.
Click on the last icon that looks like a solution (.sln) file icon (last icon on the top vertical row). It's right next to the refresh icon and just above the "Comment" box. That should clear all non-related project files, and only show the files on your current project.
In Source Control Explorer in Visual Studio, simply right-click on files and folders and choose "Delete". Then right-click again and choose "Check-in pending changes".
You need to Destroy those files first, then only those files will get removed from source control.
You can't make any changes in those files - they remain in source control until you destroy them permanently from TFS.
For more info about how to destroy see TF Destroy command utility.
The files in your screenshot are (mostly) listed as add - they are not in TFS yet, so deleting them from TFS is not what you want. Rather you want to ignore them, though that can be tricky: How to ignore files/directories in TFS for avoiding them to go to central source repository?

Why TFS doesn't add some DLL in Bin Directory?

When I added a whole solution in TFS, it didn't add one dll, I then have to add it manually.
Is there something that prevents it from doing so ?
How did you add the solution? The Add Items button will exclude a number of items through the filters you see in the dialog. There are two tabs there : Included & Excluded. When adding things to source control this way, you'll need to check the excluded tab for anything caught by the filter like 3rd party libraries.
If you used Add Solution to Source Control, I'm not entirely sure. If the dlls were in a project or a solution folder they should have been added. Again, if you give more details (step by step) I can help a little more.
Considering only 1 DLL was rejected out of several, it sounds like a TFS bug. I know don't be shocked... there are actually a few of these.
For example, I have text files get removed from my solution when I use "undo checkout". Unfortunately that problem is unpredictable, so no fix yet.
TIP: Always diff your solutions and projects before you check them in.
As Ryan said when adding to the repository certain filers are applied, e.g. you have to explicitly add dlls to the repos. See this
The problem is that you have binded the project to IIS. And IIS block access to some DLLs.
If you using Visual Studio 2012 and you can't add the files to TFS just exclude a file, add to repository, include file and check in.

Resources