TFS API: GetLocalWorkspaceInfo always returns null

前端 未结 8 1309
無奈伤痛
無奈伤痛 2020-12-24 06:46

On one of my machines, I get a return value of null from any GetLocalWorkspaceInfo call. I have isolated to problem to where it even fails for this simple progr

8条回答
  •  一个人的身影
    2020-12-24 07:06

    After migrating from TFS2013 to TFS2017 in the company I work for I had the same problem with Workstation.Current.GetLocalWorkspaceInfo.

    What worked for me is a call to Workstation.EnsureUpdateWorkspaceInfoCache:

    TfsTeamProjectCollection tpc = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri(""));
    VersionControlServer tfServer = tpc.GetService();
    Workstation.Current.EnsureUpdateWorkspaceInfoCache(tfServer, tfServer.AuthorizedUser);
    

    I added the above code lines to the constructor of my TFS proxy class that uses GetLocalWorkspaceInfo.

提交回复
热议问题