Search code examples
.netvisual-studiotfstfs-2015checkin-policy

Auto-install TFS custom check-in policy to client Visual Studio


In our project, we want to use my custom check-in policy in TFS because sometimes temporary developers need to check-in some code in the repository, but they do not carry out our project requirements. I wrote check-in policy that prevents this, but I think deploying of policy on a client by VSIX-package or registry is not a right way because a user can ignore installation of our custom policy. Can I install it automatically when a developer wants to check-in some changes into our repository?

I have got a TFS 2015 and Visual Studio >= 2015.

Thanks in advance


Solution

  • There is nothing out of the box that will allow you to force the install of your policy at time of commit. You can use a group policy to enforce the custom check-in to be installed on a developer(s) machine. This could be more of a headache depending on how your organization is setup.

    In this type of scenario, I would suggest using a gated check-in build. This will run for any developer that tries to commit to TFS (overrides can be enabled for TFS admins for emergencies) and will allow you to enforce any quality controls you need too. If the build succeeds, TFS allows the commit. If the build fails, it will reject the commit and Visual Studio will leave the changes pending on the developer's machine until they fix the issue and try to commit again.