I want to write a Visual Studio Plugin that will extend the functionality of Check-In command. What I want to happen is when a check in happens, I should be able to call an external program.
-
What is exactly your question? – Ralf de Kleine May 11 '15 at 12:07
-
Check if this works for you: http://stackoverflow.com/questions/25801982/tfs-client-side-hook – jessehouwing May 11 '15 at 12:18
1 Answers
There are a few options to trigger a script or action when a user checks in:
1. Check-in policy
A checkin policy triggers in Visual Studio when checking in. The code that triggers is simple C#, so running an application is easy using the Process
class.
These policies need to be deployed to the machines running Visual Studio. They will get an error message if the policy is not installed. You can create an MSI or vsix to deploy the policies. Or just copy them to the right folders manually.
2. Automated Build
A CI build or Gated build using a tool like Team Build or Team City would be ideal to run a program or piece of code. This would happen right after (CI) or just before (Gated) the final checkin, but they would run on the build server, not inside Visual Studio.
This can be either a MsBuild task or Team Build Activity.
3. Visual Studio Extension
You can also create a custom Visual Studio extension and then subscribe to the VersionControlServer.BeforeCheckinPendingChange
event. This happens just before checkin. You can grab the VersionControlServer
from the connected Team Project.

- 1
- 1

- 106,458
- 22
- 256
- 341