2
我寫了一個網站,向我們的姊妹公司展示TFS中的某些任務和錯誤。問題(概率驗證)通過網站連接到TFS 2008
它在我的機器上工作正常......但未部署。
在現場之外在底部"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](http://msdn.microsoft.com/zh-cn/library/bb286958 (VS.90).aspx)爲你工作的例子? – KMoraz 2012-03-24 00:18:39
nope,但感謝您的期待。最後放棄了,寫了一個程序給他們發電子表格! – 2012-03-29 13:58:12