4
我遇到了一個文件夾和一個文件,顯示在我的項目下,這是我的解決方案下的問題。這些文件被添加到TFS,但我的項目不知道該文件存在並顯示爲白色使用Team Foundation Server SDK添加文件夾和文件
Dim tfs As TeamFoundationServer = TeamFoundationServerFactory.GetServer(txtServer.Text)
' Get a reference to Source Control.
Dim versionControl As VersionControlServer = CType(tfs.GetService(GetType(VersionControlServer)), VersionControlServer)
' Create a workspace.
Dim workspace As Workspace = versionControl.GetWorkspace(txtProject.Text)
If Not String.IsNullOrEmpty(txtUpdateScript.Text) Then
Dim fooString = Array.Find(Of WorkingFolder)(workspace.Folders, Function(m) m.ServerItem.Contains("$/FOO.NET"))
Directory.CreateDirectory(IO.Path.Combine(IO.Path.Combine(txtProject.Text, "FOOAdmin\Updates"), txtVersion.Text))
Directory.CreateDirectory(fooString.ServerItem & "/FOOAdmin/Updates/" & txtVersion.Text)
IO.File.Copy(txtUpdateScript.Text, IO.Path.Combine(IO.Path.Combine(IO.Path.Combine(txtProject.Text, "FOOAdmin\Updates"), txtVersion.Text), "Update.sql"), True)
workspace.PendAdd(IO.Path.Combine(IO.Path.Combine(txtProject.Text, "FOOAdmin\Updates"), txtVersion.Text))
workspace.PendAdd(IO.Path.Combine(IO.Path.Combine(IO.Path.Combine(txtProject.Text, "FOOAdmin\Updates"), txtVersion.Text), "Update.sql"))
End If
' Get Pending changes
Dim pendingChanges As PendingChange() = workspace.GetPendingChanges()
' Checkin the items we added.
Dim changesetNumber As Integer = workspace.CheckIn(pendingChanges, "FOO.Net AutoBuild")
如果我不加入這一行
Directory.CreateDirectory(fooString.ServerItem & "/FOOAdmin/Updates/" & txtVersion.Text)
然後該項目不知道該文件夾或文件。