1
我已經創建一個控制檯應用這需要兩個參數作爲一個輸入.xml文件並給輸出作爲.htm文件如何從TFS的路徑在控制檯應用程序
下面是用於訪問TFS代碼
TfsTeamProjectCollection teamProjectCollection =
TfsTeamProjectCollectionFactory.GetTeamProjectCollection
(new Uri("http://myServer:8080/tfs/defaultcollection"));
var buildService = (IBuildServer)teamProjectCollection.GetService(
typeof(IBuildServer));
IBuildDefinition myBuildDefination = buildService.GetBuildDefinition(
"MyProjectName", "MyBuildDefinationName");
Uri lastKnownGoodBuild = myBuildDefination.LastGoodBuildUri;
IBuildDetail myBuildDetail = buildService.GetBuild(lastKnownGoodBuild);
string dropLocation = myBuildDetail.DropLocation;
但以上似乎並沒有爲我工作...所以我想手動通過路徑。 你可以看到下面的代碼片段
// i have just added blackslash at the start and my problem solved
string xmlfile = "\\\\myTfsPath\\CodeMetricsResult.xml";
if (File.Exists(xmlfile))
{
//do something
}
但由於某些原因......它總是去我else塊。
請讓我什麼我做錯了
注.... TFS的路徑是網絡和我所有的訪問。
感謝,