Uri tfsUri = new Uri("http://fors37na:8080/tfs");
TfsTeamProjectCollection server = new TfsTeamProjectCollection(tfsUri);
WorkItemStore workstore = server.GetService();
foreach (Project project in workstore.Projects)
{
Console.WriteLine("DefaultCollection集合下项目名称是:" + project.Name);
}
Console.WriteLine("---------------------------------------------------------------");
代码如上,在WorkItemStore workstore = server.GetService();
这一句出错,server中有信息,报错信息如下:
TF31002: Unable to connect to this Team Foundation Server: http://fors37na:8080/tfs.
Team Foundation Server Url: http://fors37na:8080/tfs.
Possible reasons for failure include:
- The name, port number, or protocol for the Team Foundation Server is incorrect.
- The Team Foundation Server is offline.
- The password has expired or is incorrect.
Technical information (for administrator):
The request failed with HTTP status 404: Not Found.
望大神解答