We don't have any Check-in Policy in Azure Dev Ops/Team Foundation server. Now getting error and unable to check in anything...

Soumya T Govardhana 40 Reputation points
2026-07-01T13:00:09.0333333+00:00

Hi,

We don't have any Check-in Policy in Azure Dev Ops/Team Foundation server. Now when we are trying to check in code in Visual Studio 2017 and getting Policy error as "It's not possible to operate with deprecated policies, please see Azure DevOps blog for more information. https://aka.ms/tfvc-policy-blogpost".

I ran C# code console program suggested for clearing old Check-IN policies, but it is no use. I get no policies found message and when I try my project to check-in above error shows up.

And since teamProject.SetCheckinPolicies(null); SetCheckinPolicies is depreciated I am using

teamProject.SetCheckinClientPolicies(policies); //

and Microsoft.TeamFoundationServer.ExtendedClient is version 20.256.2

Regards,

Soumya

Azure DevOps
0 comments No comments

Answer accepted by question author
Rukmini 43,915 Reputation points Microsoft External Staff Moderator
2026-07-01T18:29:25.83+00:00

Hello @Soumya T Govardhana

"It's not possible to operate with deprecated policies, please see Azure DevOps blog for more information. https://aka.ms/tfvc-policy-blogpost".

The error usually shows up when the server is enforcing (or still references) deprecated TFVC check-in policies, so Visual Studio can’t proceed with check-in even if you believe there are no active policies. Here are the most likely things to verify and what to try next.

1) Confirm whether any policies are still registered on the TFVC server

Even when your script reports “no policies found”, the error can still occur if there are deprecated policies present in the environment (for example, stored/registered in a way that the query you ran doesn’t detect the same way VS validates during check-in).

Try: re-run the policy-discovery/clear steps, but make sure you’re targeting:

  • the correct collection / team project scope (and not just “a project”)
  • any relevant policy-related storage your tool checks

(If your console app only looks for policies in one place, it may miss another location where VS/TFVC is detecting deprecated policies.)

2) Use the supported API path for setting policies (don’t rely on deprecated calls)

You noted teamProject.SetCheckinPolicies(null) is deprecated (correct), and you’re using:

  • teamProject.SetCheckinClientPolicies(policies);

That’s the right direction in principle, but the key is whether policies is truly empty and aligned to the client policy model expected by your server version.

Try: ensure the policies variable you pass to SetCheckinClientPolicies is actually an empty set/list (not null or a list that still includes deprecated entries).

3) Make sure the client/server versions are consistent with the policy system being used

You mentioned:

  • Microsoft.TeamFoundationServer.ExtendedClient version 20.256.2

If your organization’s server behavior expects a different client library version (or different policy contract), the API calls might not affect what Visual Studio is enforcing.

Update the client library and re-run the cleanup.

4) Check if the deprecated policy is coming from history or inherited state

Some policy-related configurations can behave like “it’s not visible in the UI anymore, but the system still blocks check-in”.

That matches your symptoms:

  • tool says no policies found
  • VS still blocks with “deprecated policies” wording

Try: validate the check-in target scope:

  • Are you checking in to the root repo path or a folder/branch with different policy inheritance?
  • Are you checking in to a team project that might have a different policy configuration than expected?

If the resolution was helpful, kindly take a moment to click on User's imageand click on Yes for was this answer helpful. And, if you have any further query do let us know.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

Answer accepted by question author
Jerald Felix 18,760 Reputation points Volunteer Moderator
2026-07-01T15:42:13.3933333+00:00

Hello Soumya,

Greetings! Thanks for raising this question in the Q&A forum.

This is a known change tied to the TFVC check-in policy storage migration that Azure DevOps has been rolling out. Even though your project shows no policies in Team Explorer, the old storage location can still hold obsolete policy metadata that isn't visible through the normal UI or the newer APIs. Azure DevOps is now blocking check-ins whenever that legacy metadata is present, regardless of what the Check-in Policy tab shows you.

The key detail is that SetCheckinClientPolicies writes to the newer JSON-based policy storage, so it does not touch or clear the old obsolete entries that are actually causing the block. The deprecated SetCheckinPolicies(null) method, despite the obsolete warning, is still the one Microsoft's own cleanup guidance uses because it targets the legacy storage location directly.

  1. Confirm you're a Project Administrator. This operation only succeeds if the identity running it has Project Administrator permissions on the affected Team Project.

Create a .NET Framework console app, not .NET/.NET Core. The Microsoft.TeamFoundationServer.ExtendedClient package and TfsTeamProjectCollection type require the classic .NET Framework runtime. If you build this as a .NET (Core) project it will fail or behave unexpectedly, which may explain why your current attempt returns "no policies found."

Reference the correct package. In Visual Studio, right-click the project, select Manage NuGet Packages, and install Microsoft.TeamFoundationServer.ExtendedClient. Version 20.256.2 is fine.

Use the obsolete SetCheckinPolicies(null) call specifically, not SetCheckinClientPolicies:

using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.VersionControl.Client;

var collectionUri = "https://dev.azure.com/YourOrganization/";
var currentProjectName = "YourProjectName";

using (TfsTeamProjectCollection tpc = new TfsTeamProjectCollection(new Uri(collectionUri)))
{
    var versionControlServer = tpc.GetService<VersionControlServer>();
    TeamProject teamProject = versionControlServer.GetTeamProject(currentProjectName);
    teamProject.SetCheckinPolicies(null);
}

Run the app and sign in with the same identity used for Azure DevOps when prompted. The call clears the obsolete policy metadata at the storage level, which is different from what enumerating or nulling policies through the newer client API does.

Reopen Visual Studio 2017 and attempt a check-in again. At this point the deprecated policy error should be gone. If you need any check-in policies going forward, add them fresh through Team Explorer > Settings > Source Control > Check-in Policy, since anything created from here on is stored in the new supported format.

If the error persists after this step, it's likely the obsolete metadata exists at a level the client API can't reach (this has been reported for some tenants), and you'll need to open a support ticket with Azure DevOps and reference the exact collection URL and project name so the team can inspect and clear the metadata server-side.

If this answer helps you kindly accept the answer which will help others who have similar questions.

Best Regards,

Jerald Felix.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Soumya T Govardhana 40 Reputation points
    2026-07-01T21:29:00.75+00:00

    Thank you @Jerald Felix & @Rukmini I am able to run C# console program, then scrapped my current Work folder and getting again from TFVC and updating my changes allowed me to save with out any issue. Thanks for all help

    Was this answer helpful?

    0 comments No comments

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.