I've written a website to display certain tasks and bugs in TFS to our sister company.
It works fine on my machine ... but not deployed.
In live the exception at the bottom "Work Item Store is null"
is always thrown ...
Can anyone assist please?
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");
And my MyCredentials class ...
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
}