In TFS, you are able to switch on a check-in policy that specifies that the users must specify a comment. The only problem with this is that you are able to override the policy and specify a reason why you don't want to provide a comment. Now, we are going to create a server plugin that will require a comment to be provided if any code is checked in to any folder or subfolder of a folder called Framework
. Note that because this is a server plugin, the users will check in as usual and then get a message specifying that they need to add a comment.
To get started, create a new class named FrameworkCommentRequirementSubscriber
by following the setup instructions from earlier. Name it MyCompany.FrameworkCommentRequirementSubscriber
, and then set the priority to SubscriberPriority.High
. Next, also add a reference to Microsoft.TeamFoundation.VersionControl.Server.dll
, which is located at C:\Program Files\Microsoft Team Foundation Server 12.0\Application Tier\Web Services...