Source control systems, such as Team Foundation Server (TFS), provide an extensive level of flexibility for development. Occasionally a developer can get lost in that flexibility, and the results can be painful. When the team grows beyond one or a few developers, a misstep in the source management process can result in challenges that can take days to recover from, and could potentially mean that days of development modifications would need to be reapplied.
At GNet Group, we’re accustomed to working with multiple projects in parallel for a client. Generally, our clients are working with TFS. With this in mind, here are a few tips for working with TFS.
Tip #1: When opening a project, use Team Explorer to open the solution and get the latest. Do not rely on the “recent projects” shortcuts.
Recent projects relies on your local copy of the solution and project files. If you are making changes to the project, you run the risk of checking in a version of the project that is not reflecting additions or modifications to the project that others have made since the last time you checked in your project.
Tip #2: Getting the latest version – Use ‘Get Specific Version’ for more control
By selecting ‘Get Specific Version,’ you have more options as to the behavior of getting the version of the item from Source Control. These options allow you to guarantee that you have the correct version, and remove possibility of issues with the Get Latest command. By selecting the ‘Overwrite all files…’ check box, you can guarantee that you have a clean copy of the item from Source control.
Tip #3: Select ‘Undo Pending Changes…’ if you are not intentionally making changes to the object. DO NOT select ‘Check IN’
Each time an item is checked in, it is given a new version number. If your intention is to view only (and not make changes), and in the course of referencing, you make a change, ‘Undo Pending Changes’ will revert back to the checked in version. Check In will change the version number and be reflected as a change of code.
Tip #4: Check out items with exclusive lock. While you are referencing an item, ensure that you are the only one reviewing or modifying.
Tip #5: Adjust the Source Control Environment settings to have greater control over the check-in/check-out process. The option can be found in Tools – Options – Source Control – Environment.
The default for Checked-In Items is automatic. Consider changing this to prompts so that you can be purposeful for each item you are working with.
When saving, checking out automatically guarantees that any changes that you make to the package force a check out. If the item is already checked out, the checkout will fail. In the case of multiple changes on the same item, this is likely the desired behavior.
When editing, prompting for exclusive checkout allows you to view the item without checking it out. When you do make a change, you will be prompted to check out exclusively to guarantee that your changes can be applied when you check in the item.
Tip #6: Be cautious when setting the values in the Tools – Options – Source Control – Visual Studio Team Foundation Server page.
Get Latest version of item on Check out (suggestion: Not selected)
When checked, any work that is done is being done against the latest version of the item in TFS. Although this is intended behavior in many cases, there are situations where this behavior can cause confusion. For instance, if a package requires check-out to view code within the item (such as the case of a Data flow in SSIS), the setting will check out the latest version instead of the version that was intended. This can cause developers to misunderstand code differences between what is in production as compared to what is currently being developed.
If you are looking to expand your ability to deliver SharePoint or Business Intelligence solutions at your site, it would be our pleasure for GNet Group to assist. Contact us for more information: