使用 tcm.exe 运行测试导致未找到字段:'Microsoft.TeamFoundation.TestManagement.Common.WitCategoryRefName.SharedDataSet'

Running tests with tcm.exe results in Field not found: 'Microsoft.TeamFoundation.TestManagement.Common.WitCategoryRefName.SharedDataSet'

我正在尝试使用以下命令从命令行在 Microsoft 测试管理器中 运行 自动测试用例:

TCM.exe run /create /title:"Nightly Run" /planid:5554 /suiteid:6582 /configid:97  /collection:XXX /teamproject:XXX /include /builddir:'C:\Source\' 

这会导致以下错误:

.\TCM.exe : Field not found: 'Microsoft.TeamFoundation.TestManagement.Common.WitCategoryRefName.SharedDataSet'.
At C:\Users\XXXX\Desktop\RunTest.ps1:2 char:1
+ .\TCM.exe run /create /title:"Nightly Run" /planid:5554 /suiteid:6582 /configid: ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Field not found...SharedDataSet'.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

但是,此错误发生在安装了 Visual Studio 2013.4 的 Windows Server 2012R2 计算机上,但未发生在我的本地开发计算机上(Windows 10 with VS2013.4)。

我知道 SharedDataSets 是在 VS2013.4 中引入的,但我不知道这个错误是从哪里来的,因为该命令在我的本地 pc 上没有给出这个错误。

我找到了解决办法。 运行 Windows 服务器上的以下命令修复了错误:

ngen uninstall Microsoft.TeamFoundation.TestManagement.Client
ngen uninstall Microsoft.TeamFoundation.TestManagement.Common