I had a problem with the folder and file that appears in my project, which is under my solution. Files are added to TFS, but my project does not know that the file exists and shows it as white
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")
If I do not add this line
Directory.CreateDirectory(fooString.ServerItem & "/FOOAdmin/Updates/" & txtVersion.Text)
Then the project does not know about the folder or file.
source share