So here goes my first post - it's about extending Visual Studio Team System - to force developers to post comments when Checking In items.
Of course there are a lot of articles on this topic on the web - but after starting a thread on forums.microsoft.com (http://forums.microsoft.com/MSDN/showpost.aspx?postid=645398&siteid=1)
i was asked to post my solution and this is how i got to this.
First you should create a new Class Library project (of course the plugin you will create is a DLL that you will register with VSTS through a registry key) - now that's all set add a reference to Microsoft.TeamFoundation.Version.Control that is usually located under [C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\Microsoft.TeamFoundation.VersionControl.Client.dll] .
Now all you have to do is to extend the PolicyBase class in the above mantioned namespace and you've got your plugin all set.
Now for the registration part - you should add a registry key of type REG_SZ under
HKLM\Software\Microsoft\VisualStudio\8.0TeamFoundation\SourceControl\Checkin Policies
with the name of your plugin (without the .dll extension) and the value is the absolute path to your dll.
Now for activating the freshly built plugin you shoul open VS>Team Explorer, login as an admin, right click on the project for which you want the policy to be enforced and go to Team Project Settings > Source Control.
A dialog box will pop up and under Check-In Policy click Add - you should now see here the policy you've registered - select it, click ok, ok again and you're done.
Let's hope this was helpfull enough -
Here's a link to my original project - it also contains a setup so no more headackes whith registry keys and stuff - even no coding required if you build the setup :-P.
http://hal.cs.tuiasi.ro/~mariusonofrei/CustomCheck-inPolicy.zip
Good luck !
2 comments:
Can you confirm that after the DLL is registered the next step is to simply login as an administrator and the newly regsitered custom check-in policy will appear in the Add Check-in Policy dialogue so as to be selectable for any Team Project?
Several thread posts pointed to an MSDN Walkthrough URL which stated it was necessary to use the VS SDK to have the custom check-in policy appear in the dialogue so as to be selectable.
Is having an evaluation copy irrelevant?
Cheers,
Stephen Smith
Yes i can confirm that after registering your dll in the registry you'll be able to use it without using the SDK.
I do not know about evaluation copies for sure - but my intuition :-P says it has nothing to do; let me know if you encounter any problems and we shall try to solve them !
Post a Comment