I am having a problem with a folder and a file showing up under my project which is under my solution. The files are being added to TFS but my project has no idea 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 the file.