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.ExtendedClientversion 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 and click on Yes for was this answer helpful. And, if you have any further query do let us know.