GetTestSuitesForPlanAsync not working correctly

Nazar Demchyk 0 Reputation points
2026-01-23T16:50:03.0533333+00:00

Working with Azure DevOps board automation.
GetTestSuitesForPlanAsync/GetTestSuiteById.. - methods that are created to get data for suits. But after sending dequest I got "Runtime instantiation of this attribute is not allowed".
Plan id is correct.
Project name is correct too.
Microsoft.VisualStudio.Services.TestManagement.TestPlanning.WebApi.SuiteExpand.None/Children/null - anything.

So could you tell me what is wrong please ?

Azure DevOps
{count} votes

1 answer

Sort by: Most helpful
  1. Rakesh Mishra 5,760 Reputation points Microsoft External Staff Moderator
    2026-01-26T17:52:05.08+00:00

    Hi @Nazar Demchyk ,

    Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.

    The error "Runtime instantiation of this attribute is not allowed" is a specific .NET runtime error. It typically occurs when an application running on .NET Core (or .NET 5/6/7/8) references a library built for .NET Framework that utilizes deprecated Code Access Security (CAS) attributes.

    Potential Causes & Solutions:

    • Package Version Mismatch: Ensure all your Azure DevOps related NuGet packages (e.g., Microsoft.TeamFoundationServer.Client, Microsoft.VisualStudio.Services.Client, Microsoft.VisualStudio.Services.TestManagement.TestPlanning.WebApi) are on the same version. Mixing versions can cause the loader to pull in an incorrect assembly target (e.g., a .NET Framework DLL instead of a .NET Standard one).
      • Action: Update all Microsoft.VisualStudio.Services.* and Microsoft.TeamFoundationServer.* packages to the latest stable version.
    • Check the method signature in the assembly/package you referenced

    Please let me know if above helps in 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.