26.04.2015 Views

Team Development with Visual Studio Team Foundation Server

Team Development with Visual Studio Team Foundation Server

Team Development with Visual Studio Team Foundation Server

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2. Click the Check-in Policy tab, click Add, and then select and configure the<br />

appropriate policy.<br />

Additional Resources<br />

• For more information about creating and using a custom check-in policy, see “How<br />

To – Step Through Creating Custom Check-in Policies for TFS” in this guide.<br />

• To learn how to customize a check-in policy, see “Walkthrough: Customizing Checkin<br />

Policies and Notes” at http://msdn2.microsoft.com/enus/library/ms181281(VS.80).aspx<br />

• To see sample code that will disallow selected patterns on check-in, see “Checkin<br />

Policy to Disallow Certain Patterns” at<br />

http://blogs.msdn.com/jmanning/archive/2006/02/02/523125.aspx<br />

• To see sample code that will enforce comments on check-in, see “Sample Checkin<br />

Policy: Make Sure the Comment Isn’t Empty” at<br />

http://blogs.msdn.com/jmanning/archive/2006/01/21/515858.aspx<br />

• To learn how to register a new check-in policy, see “I’ve Made a New Check-In<br />

Policy! How Do I Add It?” at<br />

http://blogs.msdn.com/jmanning/archive/2006/02/07/526778.aspx<br />

Detect When a Policy Has Been Overridden<br />

<strong>Team</strong> <strong>Foundation</strong> Version Control does not prevent you from overriding a policy.<br />

However, you can use the following steps to detect if a policy has been overridden:<br />

• Use the <strong>Team</strong> <strong>Foundation</strong> Eventing Service (from the <strong>Team</strong> <strong>Foundation</strong> Core<br />

Services API) for hooking into check-in events.<br />

• Write a Notify method that parses the details of the changeset and then react to it if an<br />

override has occurred.<br />

Alternatively, you can manually scan changeset history to discover policy overrides.<br />

Additional Resources<br />

• To learn more about overriding a check-in policy, see “How to: Override a Check-in<br />

Policy” at http://msdn2.microsoft.com/en-us/library/ms245460(VS.80).aspx<br />

• To learn more about the <strong>Team</strong> <strong>Foundation</strong> Eventing Service, see “Eventing Service”<br />

at http://msdn2.microsoft.com/en-us/library/bb130154(vs.80).aspx<br />

• To learn how to receive an e-mail message when a policy has been violated, see<br />

http://blogs.infosupport.com/marcelv/archive/2005/10/18/1635.aspx<br />

Plan to Avoid Conflicts<br />

Plan to avoid having multiple developers working in the same region of the same source<br />

file at the same time. Do this to avoid conflicts that are potentially difficult to correctly<br />

resolve. While automatic conflict resolution can resolve many conflicts, you should avoid<br />

situations where two or more developers are working on the same method, or on the same

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!