- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有这个 nuget 包(和非扩展包):https://www.nuget.org/packages/Microsoft.TeamFoundationServer.ExtendedClient/
我看到它被引用为 Microsoft.TeamFoundation.VersionControl.Client.dll 的替代品。不幸的是,我正在尝试访问 Microsoft.TeamFoundation.VersionControl 命名空间,但它似乎不存在。我看到 Git 和 SourceControl 的条目,但 VersionControl 抛出“类型或命名空间名称‘VersionControl’不存在于命名空间‘Microsoft.TeamFoundation’中(是否缺少程序集引用?)”并且 Intellisense 没有提出任何建议else 用于关于 VersionControlServer 等的 Using 语句。
我的意图是使用带有访问 token 的 TFVC,让自动化服务器拉下一个工作区,操作一些文件,然后上传到一个新的工作区。我已经制定并编写了其余的逻辑,但“丢失”的引用只会导致问题。
我也没有真正看到任何关于它可能去了哪里的文档。有什么想法吗?
最佳答案
没有Microsoft.TeamFoundation.VersionControl命名空间,也没有VersionControl类,VersionControlServer在Microsoft.TeamFoundation.VersionControl.Client命名空间中。
创建工作区、添加文件和 checkin 的简单示例:
NetworkCredential cred = new NetworkCredential("[account name]", "[person access token]");
TfsTeamProjectCollection tpc = new TfsTeamProjectCollection(new Uri("https://[xxx].visualstudio.com"), cred);
tpc.EnsureAuthenticated();
VersionControlServer versionControl = tpc.GetService<VersionControlServer>();
Workspace workspace = versionControl.CreateWorkspace("TestWorkspace", versionControl.AuthorizedUser);
try
{
String localDir = @"c:\temp\BasicSccExample";
//Console.WriteLine("\r\n--- Create a mapping: {0} -> {1}", args[1], localDir);
workspace.Map("$/Agile2015/APIFolder", localDir);
workspace.Get();
Console.WriteLine("\r\n--- Create a file.");
topDir = Path.Combine(workspace.Folders[0].LocalItem, "sub");
Directory.CreateDirectory(topDir);
String fileName = Path.Combine(topDir, "basic.txt");
using (StreamWriter sw = new StreamWriter(fileName))
{
sw.WriteLine("revision 1 of basic.txt");
}
Console.WriteLine("\r\n--- Now add everything.\r\n");
workspace.PendAdd(topDir, true);
Console.WriteLine("\r\n--- Show our pending changes.\r\n");
PendingChange[] pendingChanges = workspace.GetPendingChanges();
Console.WriteLine(" Your current pending changes:");
foreach (PendingChange pendingChange in pendingChanges)
{
Console.WriteLine(" path: " + pendingChange.LocalItem +
", change: " + PendingChange.GetLocalizedStringForChangeType(pendingChange.ChangeType));
}
Console.WriteLine("\r\n--- Checkin the items we added.\r\n");
int changesetNumber = workspace.CheckIn(pendingChanges, "Sample changes");
}
关于c# - Microsoft.TeamFoundation.VersionControl.Client 位置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39841615/
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
我是一名优秀的程序员,十分优秀!