3

I've created a plugin for a program adding TFS-VCS integration to that program using the Microsoft.TeamFoundation.*-Namespaces.

Basicaly that works, but now I have a problem with custom checkin policies:
We have 2 checkin policies activated for the project: The ChangesetCommentPolicy from the TFS Power Tools and a custom policy wich is created by us. Both work in Visual Studio and the Shell Integration, but in my plugin I get the following error:

Internal error in Changeset Comments Policy. Error loading the Changeset Comments Policy policy. Installation instructions: To install this policy, follow the instructions in CheckForComments.cs.

Same for our custom policy, just with the other policy name.

Here a code snippet how I get the policy warnings:

//CurrentWorkspace is Microsoft.TeamFoundation.VersionControl.Client.Workspace
CheckinEvaluationResult result = Manager.CurrentWorkspace.EvaluateCheckin(CheckinEvaluationOptions.Policies,
    PendingChanges.ToArray(), changes.ToArray(), textBoxComment.Text, GetCurrentCheckinNotes(), GetSelectedWorkItems());
if (result.PolicyEvaluationException != null || result.PolicyFailures.Length > 0)
{
    labelPolicyWarning.Text = "The following check-in policies have not been satisfied";
    pictureBoxWarning.Visible = true;

    foreach (PolicyFailure failure in result.PolicyFailures)
    {
        items.Add(failure);
    }
    if (result.PolicyEvaluationException != null)
        items.Add(result.PolicyEvaluationException);

    objectListViewPolicyWarnings.SetObjects(items);
}
else
{
    labelPolicyWarning.Text = "All check-in policies are satisfied";
    pictureBoxWarning.Visible = false;
}

How can I "load" the policies in my plugin so they can be executed?

P.S.: The program the plugin is for is FlashDevelop if that matters.

Christoph Fink
  • 22,727
  • 9
  • 68
  • 113

2 Answers2

4

I got same error message while calling tfs checkin in my program. After searching for a little while, it seems that the error message came from the Team explorer, after installing TFS power tools 2010 , this message didn't show anymore.

tss
  • 59
  • 4
  • which version of Team explorer are you using, TFS Power Tools 2010 only works with Team explorer 2010. There are TFS power tools 2005/2008 existed also. – tss Nov 17 '11 at 03:47
0

It seems this is not supported at the moment as even MS does not have a solution: http://social.msdn.microsoft.com/Forums/pl-PL/tfsgeneral/thread/344b1846-d571-4d17-842b-70fc05f5a83a

Christoph Fink
  • 22,727
  • 9
  • 68
  • 113