How can I restrict a custom TFS checkin policy to be evaluated only on checkin? RRS feed

  • Question

  • I have created a custom TFS checkin policy that needs to parse and evaluate the source files during checkin.

    This can be a quite expensive process, especially if many files are part of the changeset.

    And, it only needs to be evaluated exactly once during the actual checkin.

    However, currently the framework calls the Evaluate method many times, even before a checkin is initiated by the user.

    For example, any time the Pending Changes window is displayed / updated the framework calls Evaluate.

    How can I restrict / avoid this?

    Friday, February 23, 2018 10:26 PM

All replies

  • Hi BullyOwner,

    Thanks for posting here.

    I asked someone familiar with this topic and he gave me the following feedback:

    Before you check-in, TFS evaluates pending changes in your working directory. Here TFS evaluates the check-in policy for the first time. If the policy evaluation fails you get a warning. And once a user invokes the Check In Pending Changes command or just opens the Pending Changes view in Team Explorer, the policy is evaluated.


    Besides, if possible, please check if following similar thread could give you some help:


    If above not help you, please open a new thread on stackoveflow with TFS tag, since this forum is MSBuild.

    More community members and MVP on that forum may further look at your issue and provide more suggestions.

    Thanks for your understanding and cooperation.

    MSDN Community Support Please remember to click Mark as Answer. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, February 26, 2018 7:16 AM