I have a custom TFS checkin policy that is used for some of the project in the company. Some of the projects are huge and running the policy for them takes about 10 seconds or so. It is OK to spend 10 seconds every time when someone checks in, because it is going to prevent from problems being created that may take hours. So policy really helps. The issue I am having is, VS is firing the policy not just for checkins, it is firing it from checkouts and saving the checked out file. That is really annoying for everyone. And now I see that developers are disabling the policy to avoid VS freezing.
Anyone knows why would Visual Studio run the policy during the checkout and save?
I don't think VS has any settings that could prevent from running other than checkin, but is there are way in code that I can identify whether the action is Checkin, checkout or save so that I could write my logic accordingly?