18

We have a new ASP.NET project on VS 2008 environment, and a new TFS server was setup for it, but originally the bin folder of the project also got checked-in.

The team has about 10 active developers at a time and it a big issue now as some of the common libraries remains checked-out by someone or other.

As per the best practice, I now wish to fix this issue and remove the bin folder out of the version control AND I need to ensure that from now on, when a developer checks-in his project, the bin folder again does not gets checked-in. How do I ensure the both things with the correct approach? It would be great if I can do something as an TFS Admin so that from the next day all developers automatically get some settings pulled into their boxes so that they stop checking-in the bin folder once I have removed it from TFS control.

I am a beginner in TFS, as earlier I used SVN primarily, so please point me to the proper steps, documentation. Thanks!

1
  • How did you add the project/solution? How do you interact with TFS source control for your project for committing changes? Apr 3, 2011 at 15:39

1 Answer 1

29

Delete the bin folder in solution explorer, this will add a delete to the pending checkins.

A build should re-create the bin folder, but not add the folder to the project (and thus there'll be no prompting for it to be added to version control).

This won't prevent someone adding it (or anything it contains) back into version control outside of VS (eg. from the command line, or adding the bin folder back into a project). I don't think there is anything you can do to stop arbitrary files being added except training (if your developers cannot handle this, how do they handle all the other "don't do that"s associated with development?)

Updated, since this was written TFS (including VSTS and Visual Studio1) allow files and folders to be ignored via a .tfignore file.


1 Often Visual Studio does not pick up changes to the .tfignore file, needing a restart.

5
  • so once I delete the folder and then check-in my solution, what exactly will happen the next time a developer (who had perhaps taken latest version yesterday) does a check-in of the solution? In his copy, he may have some files from BIN checked-out perhaps? Apr 3, 2011 at 17:27
  • @SaurabhKumar: there will be a merge conflict (I think: I've never tried a delete vs. change conflict). If the files are binary they can only be checked out by a single person (I would suggest non-binary files in bin in the project is the wrong approach: better to use "copy to output" build action). Suggestion: Set up a test project with two workspaces (these can be on the same system) and test it.
    – Richard
    Apr 4, 2011 at 7:03
  • I realize this is a super old post, but i'm wondering why no one has suggested an implementation of a .tfignore file to ensure the bin folder remains out of source control for all developers and without the need for specific training...
    – Nugs
    May 19, 2017 at 15:22
  • @Nugs because when this was written there was no such thing
    – Richard
    May 19, 2017 at 15:23
  • @Richard i figured as much, but thought i would throw an update in the bucket anyways... I happen to be doing some searching myself right now around a similar topic, so i just happened on this post... stackoverflow.com/questions/44073534/…
    – Nugs
    May 19, 2017 at 15:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.