9
votes

We're trying out Visual Studio 11 Beta. Everything is going fine except that we can't check in files without ignoring several check-in policy failures. For example:

Internal error in Changeset Comments Policy. Error loading the Changeset Comments Policy policy (The policy assembly 'Microsoft.TeamFoundation.PowerTools.CheckinPolicies.ChangesetComments, Version=8.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not registered.). Installation instructions: To install this policy, follow the instructions in CheckForComments.cs.

We're using some of the check-in policies from the TFS Power Tools. They obviously work just fine with Visual Studio 10. But I need to get them working in VS11, too. I've tried adding the registry keys to register the policies for Visual Studio 11:

Registry keysRegistry location

I've also tried adding several binding redirects to the devenv.exe.config file because those TFS Power Tools policy assemblies reference the Visual Studio 10 assemblies.

<dependentAssembly>
    <assemblyIdentity name="Microsoft.TeamFoundation.WorkItemTracking.Client" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
    <bindingRedirect oldVersion="10.0.0.0-99.9.0.0" newVersion="11.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
    <assemblyIdentity name="Microsoft.TeamFoundation.VersionControl.Common.Integration" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
    <bindingRedirect oldVersion="10.0.0.0-99.9.0.0" newVersion="11.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
    <assemblyIdentity name="Microsoft.TeamFoundation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
    <bindingRedirect oldVersion="10.0.0.0-99.9.0.0" newVersion="11.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
    <assemblyIdentity name="Microsoft.TeamFoundation.Common.Library" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
    <bindingRedirect oldVersion="10.0.0.0-99.9.0.0" newVersion="11.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
    <assemblyIdentity name="Microsoft.TeamFoundation.WorkItemTracking.Client.DataStore" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
    <bindingRedirect oldVersion="10.0.0.0-99.9.0.0" newVersion="11.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
    <assemblyIdentity name="Microsoft.TeamFoundation.WorkItemTracking.Proxy" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
    <bindingRedirect oldVersion="10.0.0.0-99.9.0.0" newVersion="11.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
    <assemblyIdentity name="Microsoft.TeamFoundation.WorkItemTracking.Client.Cache" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
    <bindingRedirect oldVersion="10.0.0.0-99.9.0.0" newVersion="11.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
    <assemblyIdentity name="Microsoft.TeamFoundation.WorkItemTracking.Client.RuleEngine" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
    <bindingRedirect oldVersion="10.0.0.0-99.9.0.0" newVersion="11.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
    <assemblyIdentity name="Microsoft.TeamFoundation.WorkItemTracking.Client.Provision" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
    <bindingRedirect oldVersion="10.0.0.0-99.9.0.0" newVersion="11.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
    <assemblyIdentity name="Microsoft.TeamFoundation.WorkItemTracking.Client.QueryLanguage" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
    <bindingRedirect oldVersion="10.0.0.0-99.9.0.0" newVersion="11.0.0.0"/>
</dependentAssembly>

<dependentAssembly>
    <assemblyIdentity name="Microsoft.TeamFoundation.PowerTools.CheckinPolicies.ChangesetComments" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
    <bindingRedirect oldVersion="8.1.0.0-9.9.0.0" newVersion="10.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
    <assemblyIdentity name="Microsoft.TeamFoundation.PowerTools.CheckinPolicies.CustomPathPolicy" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
    <bindingRedirect oldVersion="8.1.0.0-9.9.0.0" newVersion="10.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
    <assemblyIdentity name="Microsoft.TeamFoundation.PowerTools.CheckinPolicies.ForbiddenPatterns" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
    <bindingRedirect oldVersion="8.1.0.0-9.9.0.0" newVersion="10.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
    <assemblyIdentity name="Microsoft.TeamFoundation.PowerTools.CheckinPolicies.WorkItemQueryPolicy" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
    <bindingRedirect oldVersion="8.1.0.0-9.9.0.0" newVersion="10.0.0.0"/>
</dependentAssembly>

But still, no luck. I'm getting the same errors. Any ideas? Has anyone else gotten the TFS Power Tools checkin policy pack to work with VS 11? Have you been able to get any check-in policy to work with both VS10 and VS11?

4
This works fine in our TFS 2010/VS11 environment.DaveShaw
You mean it works fine out of the box or it works fine after adding the registry values and the binding redirects?Matt Varblow
Out of the Box, we have TFS2010 and the TFPT Changeset Comments Checkin Policy Turned on. A few of us have installed VS11 and the policy just works.DaveShaw
@DaveShaw - Yep, the Changeset Comments Policy "just works" because it is now included with the VS11 install. Unfortunately it was the only checkin policy that 'graduated' from the Power Tools to in-the-box and you'll still need to use either the TFPT 2010 or TFPT11 custom checkin policies (when they become available).Grant Holliday
@GrantHolliday Thanks for the clarification.DaveShaw

4 Answers

6
votes

We were successfully using the 2005 TFPT with VS 2005, 2008, 2010. However, out of the box, the 2005 and 2008 TFPT will not work with VS11. But, as Dave suggested in the comments, some of the 2010 TFPT check-in policies will work out of the box with VS11. Here's what I discovered with a bit more experimentation:

When I changed the policy configuration in TFS to use the TFPT 2010 policies the Changeset Comments policy worked fine out of the box - no registry or config file hacking required. The Custom Path and Forbidden Patterns policies did not.

FYI - To reconfigure TFS to use the TFPT 2010 policies I simply removed the policies (from the Source Control Settings dialog) and then added them again. The key is to re-add the policies from a computer with TFPT 2010 installed (not TFPT 2005 or 2008).

If you're OK with the registry and config file hacks, see this post for hacks that will work for all the TFPT 2010 policies:

http://social.msdn.microsoft.com/Forums/en-US/tfsversioncontrol/thread/6bd4fe2f-b06a-49c4-a4d0-5a75d3dc3dd3/

Update:

Here's the response I received from Microsoft on the forum thread (link above):

The changeset comments policy was rolled into the product -- it's no longer part of the power tools. We've also done some additional work to make the in-box VS 2010 and VS 11 check-in policies play nicely with each other (you should be able to set them up with either client and have them work with either client). We should do this same compatibility work to the rest of the power tools check-in policies before we ship the final version. I'll file a work item to make sure this happens -- but I'm not sure it made it in for the Beta version of the VS 11 power tools. (I don't think the Beta power tools are out just yet -- but they're almost done.)

1
votes

it occurs when migrating from 2010 to 2012. get in the defination remove the policy and addit again, so simple so easy.

0
votes

Beta power tools are out (see link below), but for the production, we'll have to wait.

http://visualstudiogallery.msdn.microsoft.com/27832337-62ae-4b54-9b00-98bb4fb7041a

0
votes

Visual Studio 2012 Update 1 (or later) fixes the root cause. See Buck Hodges' blog about this:

http://blogs.msdn.com/b/buckh/archive/2012/10/19/internal-error-loading-the-changeset-comments-checkin-policy.aspx