Geeks With Blogs
I [heart] code! .NET musings from the chick side

In VSS you had to add the file to the VSS project explicitly. I can't count the times that the solution in VSS did not compile because someone had added new file to their solution, referenced it from existing code, and then forgot to add the new file to source control. When the developer compiled the solution prior to check in, it compiled on her local environment because she had the file, so she thought all was well.

 

The file addition on check-in in Team System Version Control (TSVC) that in my opinion is a vast improvement over VSS.

When you add files to your project (such as a new project, new class, or new external dependency file), the new file appears in your solution with a yellow cross to indicate that is new and does not yet exist in source control. Here I added a new test class to my test project called ContentCacheTest.cs. The file was actually through the Create Unit Tests Wizard. Team System checked out the test project

 

SolutionExplorer

 

It is also added to source control at that time:

 

Source Control

 

 

When you check in your changeset, the new file is added to source control automatically.

 

The model of checking in a file addition does have one aspect that "got" me. When you add a file directly to source control, you still need to check in the file, or it doesn't "officially exist" in source control.

 

For example:

I am using Rhino Mocks in my tests, so I added the Rhino.Mocks.dll to my  "ExternalDependencies" folder in the team project and then referenced it from my project. I checked the project in as changeset "Add Rhino.Mocks".

 

I then added the Rhino.Mocks assembly files to Source Control inthe corresponding ExternalDependencies folder by clicking on the add button. They appeared in Source Control and my project built fine. when I ran my build on the build server however, it failed with the following error:

BlogMLReaderTest.cs(4,7): error CS0246: The type or namespace name 'Rhino' could not be found (are you missing a using directive or an assembly reference?)

Hmm, but I did add the Rhino.Mocks assembly to Source Control - I can see it!

 

RhinoMockAddVC

 

But wait - It has a yellow cross next to it and the Pending Change column shows "add". So just adding the files to Source Control does not make them part of the source code (as it did in VSS).

 

I checked in the two files, ran my build on the build server, and all was well.

Posted on Wednesday, May 28, 2008 11:19 AM | Back to top


Comments on this post: Adding files to TFS Team System Version Control

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Kirstin Juhl | Powered by: GeeksWithBlogs.net