- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试编写一个脚本来使用 powershell 连接到 TFS,但是我卡在了实际连接的部分
$credentialProvider = new-object Microsoft.TeamFoundation.Client.UICredentialsProvider
$collection = [Microsoft.TeamFoundation.Client.TfsTeamProjectCollectionFactory]::GetTeamProjectCollection($uri, $credentialProvider)
报错说找不到类型
[ERROR] New-object : Cannot find type [ERROR] [Microsoft.TeamFoundation.Client.UICredentialsProvider]: verify that the [ERROR] assembly containing this type is loaded.
好吧,我首先尝试这样做,但没有帮助
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.TeamFoundation.Client")
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.TeamFoundation.WorkItemTracking.Client")
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.TeamFoundation.Build.Client")
我的开发环境中只安装了 Visual Studio 2015。是否有一些我缺少的组件是使用 powershell 与 TFS 交互所必需的?
此外,我不知道该脚本将从何处运行(它不会来自开发机器),大概是从可以直接访问 TFS 服务器的机器(可能使用 Team Explorer)运行。
最佳答案
在您安装 Team Explorer 2013 或更低版本时,Team Foundation Server 客户端对象模型曾经被安装到全局程序集缓存中。因此,它们总是很容易从任何脚本加载。
在 Team Explorer 和 Visual Studio 2015 及更高版本中,包不再全局注册。同时,Microsoft 更改了许可证并使这些程序集可以随您的应用程序一起分发,并发布了一个 NuGet 包以使分发更容易。
处理需要 TFS 客户端对象模型的情况的正确方法是将它们与脚本打包或使用 Nuget 按需下载。
根据您在脚本中执行的操作,您可能需要也可能不需要许多软件包:
传统客户端对象模型:
新型 REST API 对象模型:
您可以使用这个小片段来动态获取 nuget.exe 和依赖项:https://stackoverflow.com/a/26421187/736079或者使用 powershell v5 中引入的 install-package
。
注意:如果您正在更新或创建新脚本,建议切换到 the new-style REST API's and the object model随之而来的是。
关于powershell - 无法找到类型 [Microsoft.TeamFoundation.Client.TfsTeamProjectCollectionFactory],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49366947/
using Microsoft.TeamFoundation.TestManagement.Client; 我遇到过 - TypeLoadException 未处理 错误描述说: Could not
我有一个从托管 TFS 中提取数据的 MVC 应用程序,当我部署它时出现此错误 Could not load type 'Microsoft.TeamFoundation.Client.BasicAu
我试图加载程序集,以便可以从Powershell连接到TFS,但是尝试添加类型时出现错误。 nuget软件包已成功下载,并且我要添加的程序集存在该文件。 我的代码如下 $sourceCodeDirec
我需要在我的项目中引用 Team Foundation 程序集,但我不能。 在 GAC 中查找 Microsoft.TeamFoundation.* 时,我找不到任何程序集。然后我浏览到 C:\win
所以在 Visual Studio 扩展中,当按下菜单项时,我想检查团队资源管理器中的当前页面是什么。 所以,首先我得到 ITeamExplorer 对象: ITeamExplorer teamExp
我在使用 .net 4.0 的 ASP.NET MVC 4 应用程序中添加了以下引用。 我还在我的应用程序中包含了命名空间,但我仍然看到以下错误: Reference : Microsoft.Tea
在新版本的 TeamFoundation 2013 默认构建模板中,缺少 Workspace 变量。它需要作为一些关键事件的输入参数,如 ConvertWorkspaceItem。如何获取 TfvcT
请任何人知道在 tfs 上 checkin 文件时导致此错误的原因: “'Microsoft.TeamFoundation.Framework.Server.ByteArray' 的类型初始值设定项引
我正在尝试编写一个脚本来使用 powershell 连接到 TFS,但是我卡在了实际连接的部分 $credentialProvider = new-object Microsoft.TeamFound
我有这个 nuget 包(和非扩展包):https://www.nuget.org/packages/Microsoft.TeamFoundationServer.ExtendedClient/ 我看
您好,有人知道我在哪里可以找到使用 nuget 的 Microsoft.TeamFoundation.Framework.Client 吗?我找不到它,因为我正在尝试创建 TfsConfigurati
我只是在寻找 Microsoft teamfoundation dll 的某种替代品。我们正在使用 visual studio 2013 开发我们的软件,我们的更新程序软件从 TFS 中提取信息。 大
使用 TFS 2015 update 2,在一台机器上安装了一个代理,代理创建了它的工作空间: 内部开发的一些自定义 MSBuild 任务已在将在代理上运行的构建定义中实现。这些任务对 TFS 服务器
在源代码管理下加载项目时,我在 VS2013 中收到此错误: 程序包“Microsoft.VisualStudio.TeamFoundation.VersionControl.HatPackage、M
我是否只需要安装 VS2010 SDK ? 有没有像TFS2010 SDK这样的东西,如果有,那是我需要安装的东西,如果有,我在哪里可以得到它? 关于微软的 "Extend Visual Studio
我正在尝试从指定过程参数的 Powershell 中对构建进行排队。我收到以下错误...知道我做错了什么吗? 无法找到类型 [Microsoft.TeamFoundation.Build.Workfl
我正在编写一个从 TFS 获取错误的应用程序。当我在安装了运行 Windows 8 的 visual studio 的机器上运行这个程序时,它工作正常。当我在我的一台运行 Server 2008 R2
我正在 Visual Studio 2015 中构建一个应用程序,以允许人们查看 TFS 服务器的变更集。 我找到了一些示例代码,但它需要引用 Microsoft.TeamFoundation.Fra
我正在尝试通过 WEB API 将工作项提交到 TFS“在线”。它在我的本地机器上工作正常,但是当我将它上传到共享主机服务器时它不工作。 发生了错误。调用 COM 组件返回错误 HRESULT E_F
我必须提供哪种凭据才能正常工作 $tfsServer = [Microsoft.TeamFoundation.Client.TeamFoundationServerFactory]::GetServe
我是一名优秀的程序员,十分优秀!