Team Foundation Server: Custom check-in policy working in VS2010 but not VS2008

1.6k views Asked by At

We've got a server with Team Foundation Server 2008 installed on it. Clients using Visual Studio 2008 and Visual Studio 2010 connect to it. I've written a custom check-in policy for TFS which is working as expected in VS2010 but not in VS2008.

I originally developed it in VS2010 but had some issues getting it working. To rule out problems with my custom policy, I recreated the Solution and Project in VS2008 (as I had a working sample in VS2008).

Once developed, I then tried setting it in VS2010 but had some issues. I found this posting by Grant Smith (http://connect.microsoft.com/VisualStudio/feedback/details/553740/vs-2008-tfs-checkin-policies-fail-to-load-with-vs-2010) who suggested to change the binding redirects for VS2010. This resolved the problem and policy is now working fine for it.

However, it is not working for VS2008. When I try to check-in any code it says: "TF10139: The following check-in policies have not been satisfied. Internal error in My Custom Checkin Policy".

When I try to change the settings for the policy, it gives me an error saying: "Error loading the My Custom Checkin Policy policy (The policy assembly 'MyCheckinPolicy, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not registered.). Installation instructions:".

Even though it says "Installation instructions:" at the end of the error message, nothing else is displayed.

Does anyone know why this may be happening.

TIA

1

There are 1 answers

0
Daz Eddy On

You will likely find that your policy will work with vs2010 if you reference the v10.x.x.x client dlls and vs2008 if you reference the v9.x.x.x dlls.

I have not found a way to have a single policy dll that works with both but I have found that if I compile the dll twice (once for each VS) I can install both dlls on my system and then modify the Checkin Policies registry entry so that each VS points to the correct dll.