【问题标题】:Issue (prob Authentication) Connecting to TFS 2008 via a Website问题(prob 身份验证)通过网站连接到 TFS 2008
【发布时间】:2013-11-26 22:17:20
【问题描述】:

我写了一个网站来向我们的姊妹公司展示 TFS 中的某些任务和错误。

它在我的机器上运行良好......但没有部署。

在 live 底部的异常 "Work Item Store is null" 总是被抛出...

有人可以帮忙吗?

ICredentialsProvider credentials = new MyCredentials("myusername", "mydomain", "mypassword");

var tfsProjectCollection = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri(tfsURL), credentials);

tfsProjectCollection.EnsureAuthenticated();

var wis = (WorkItemStore)tfsProjectCollection.GetService(typeof(WorkItemStore));

if (wis == null) throw new Exception("Work Item Store is null");

还有我的 MyCredentials 类 ...

public class MyCredentials : ICredentialsProvider
{
    private NetworkCredential credentials;

    #region ICredentialsProvider Members

    public MyCredentials(string user, string domain, string password)
    {
        credentials = new NetworkCredential(user, password, domain);
    }

    public ICredentials GetCredentials(Uri uri, ICredentials failedCredentials)
    {
        return credentials;
    }

    public void NotifyCredentialsAuthenticated(Uri uri)
    {
    }

    #endregion
}

【问题讨论】:

  • this 示例对您有用吗?
  • 不,但感谢您的关注。最后放弃了,写了一个程序给他们发送电子表格!

标签: tfs tfs-sdk


【解决方案1】:

您有连接问题,它在您的机器上工作正常,因为您的机器访问 TFS 服务器,但您的包含已部署网站的机器未连接到您的 TFS 服务器。 连接到同一个域的两台机器(网络问题,或者确保你在 TFS 上配置的防火墙接受你的部署机器)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-11-02
    • 1970-01-01
    • 2015-04-10
    • 2019-12-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多