Azure DevOps: Obsolete TFVC policies warning cannot be resolved - policies not visible in Visual Studio or tf.exe

Daniel Abell 0 Reputation points
2026-05-26T20:56:02.55+00:00

Our Azure DevOps organization is displaying this warning:

"This organization has a project that is running an obsolete version of TFVC policies. You must update the policies to avoid any disruption in service."

We have tried everything we can find to resolve it:

  1. Visual Studio Team Explorer - Team Explorer → Settings → Source Control → Check-In Policy shows "It's not possible to operate with deprecated policies" but no policies are listed.
  2. REST API - Queried /_apis/policy/configurations?api-version=7.0 for all 8 projects in the org. All return empty or only a legitimate Git policy.
  3. tf.exe - tf vc policy is not a recognized command.

Has anyone successfully resolved this? The policies seem to be stored in a legacy format that no current tooling can access or delete. Is there a way to clear these through the API or another tool, or does this require Microsoft backend intervention? I added a new check-in policy and went back to Source Control > Check-in policies and I received the warning again the policy listing was again blank

Azure DevOps

Answer recommended by moderator
Rakesh Mishra 11,340 Reputation points Microsoft External Staff Moderator
2026-05-26T21:22:45.83+00:00

Hello Daniel,

The reason you are unable to save new policies and keep getting the warning is that Azure DevOps blocks any configuration saves when it detects a mix of obsolete and new policies. Because the obsolete policies are hidden from the current Visual Studio UI and cannot be deleted from there, your project is essentially stuck in a state where the legacy policies block any check-ins and edits.

As you noticed, the REST API (/_apis/policy/configurations) is strictly for Git branch policies, and tf.exe does not have an active policy management command to solve this.

To clear these hidden obsolete policies, you will need to run a small C# application using the legacy TFVC client API. Once they are cleared, the Check-in Policies tab will properly register new built-in policies without warnings.

Here are the exact steps and code to remove the deprecated policy metadata:

  1. Create a new C# Console App (.NET Framework 4.8) in Visual Studio. (Note: Do not use .NET Core / .NET 5+ as the legacy client Object Model requires .NET Framework).
  2. Install the following NuGet package: Microsoft.TeamFoundationServer.ExtendedClient (v19.x or latest).
  3. Use the following code in your Program.cs. Replace {UrlToYourCollection} (e.g., https://dev.azure.com/yourorg) and {YourProjectName} with your specific details:
       using System;
       using Microsoft.TeamFoundation.Client;
       using Microsoft.TeamFoundation.VersionControl.Client;
       
       namespace ClearTFVCPolicies
       {
           class Program
           {
               static void Main(string[] args)
               {
                   var collectionUri = "{UrlToYourCollection}";
                   var currentProjectName = "{YourProjectName}";
    
                   using (TfsTeamProjectCollection tpc = new TfsTeamProjectCollection(new Uri(collectionUri)))
                   {
                       // Authenticate and get the Version Control Server
                       var versionControlServer = tpc.GetService<VersionControlServer>();
                    
                       // Get the specific Team Project
                       TeamProject teamProject = versionControlServer.GetTeamProject(currentProjectName);
                    
                       // Clear the obsolete policies by setting them to null
                       teamProject.SetCheckinPolicies(null);
                    
                       Console.WriteLine("Obsolete check-in policies have been successfully cleared.");
                       Console.ReadLine();
                   }
               }
           }
       }
    

Note: You must be a Project Administrator to successfully run this script.

Once you run this code, restart Visual Studio, go back into Team Explorer -> Settings -> Source Control -> Check-in Policy, and you will now be able to add the updated policies without receiving the warning.

Reference: TFVC check-in policy migrate guide - Remove existing obsolete policies

Note: This response is drafted with the help of AI systems.

Was this answer helpful?


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.