Has the Team Foundation ASP.Net, VersionControlServer class been deprecated?

Clark, Stace 1 Reputation point
2021-08-10T20:50:16.717+00:00

Hello,

We have switched from OnPrem TFS Server 2019 (Devops) and now are in the cloud Azure Devops.

I am trying to connect to a TFVC Repository hosted in Azure via ASP.NET Web Form - C# code (which has worked in the past with OnPrem).
It looks like I can connect to he Azure "TeamProjectCollection", but the Object Properties are null, like "AuthorizedUser"

I am now using a PAT to connect, vs. username and password.

Has the Team Foundation ASP.Net, VersionControlServer class been deprecated? if so, is there another Class similar to VersionControlServer class.

Code fails on CreateWorkspace

Workspace workspace = DevOps.VersionControlServer.CreateWorkspace(workspaceName, DevOps.VersionControlServer.AuthorizedUser);  

I also have the latest NuGet Packages (it installed a bunch of WebApi.dll's etc.)
122024-image.png

any pointers to solve this issue are greatly appreciated.
thanks.

122097-azure-versioncontrolservererror.png

Developer technologies | ASP.NET | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Clark, Stace 1 Reputation point
    2021-08-10T21:20:20.177+00:00
    DevOps.MirthTeamProjectCollection = new TfsTeamProjectCollection(url, credentials);
    DevOps.MirthTeamProjectCollection.Authenticate();
    

    added this line:

    DevOps.MirthTeamProjectCollection.Authenticate();
    

    and now all is well again. thanks.

    0 comments No comments

Your answer

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