Confused about adding an existing file to Team Foundation Server (TFS) - tfs

I am trying to add the file "DSTB_QB.xml" to an existing project in TFS. I added the file to an existing project from Source Control Explorer using "Add Items to Folder", but I have to check it out separately from the rest of the project. Additionally, although it appears in the "App_Data" folder (which is where I want it) in my local workspace, it does not appear under the "App_Data" folder in Solution Explorer. It is as if this file is under source control, but not part of the project. How can I make the file part of the project?

You can not add just with Source Control Explorer because you Visual Studio Project does not know why some file exist on file system (maybe this temporary file). But if you add existing file with Solution Explorer to existing project this file will be added to source control automatically.

I fixed the problem by right-clicking on the "App_Data" folder in Solution Explorer and selecting "Add->Existing Item". I'm not sure if that's what the above commenter meant, but it worked.
Now my question is: Why did I have to add the file in Source Control Explorer AND in Solution Explorer? More specifically, why wasn't adding it in Source Control Explorer sufficient?

Related

SSIS Project will not show a new folder added

I created a folder called BatchFiles in TFS for an SSIS project, but the folder will not show in the solution explorer. I've also noticed that .dtproj file will not show, even if I click the "Show All Files" button on top. Is there any way to show the new folder I created in solution explorer? Also will the .dtproj file always be hidden?
Add new item directly to the project does this:
Adding an existing item option automatically dumped it in Miscellaneous Folder, that looks like this:
Seems like those existing items are not being considered as project files but as misc files when being opened from solution explorer.
This seems to be an expected behavior
Any files in the dialogue box which does not have extension such as
dtsx or config .Selecting these files will automatically place them in
Miscellaneous folder
How to Add a File to the SSIS Project Miscellaneous Folder
If the file exists on disk (physically in the folder) but does not show in the solution then it is likely that the file was checked in, but the modification to the solution was not. And for BatchFiles folder, you just add them in the source control explorer. That's why there are not the in the solution explorer.
Also will the .dtproj file always be hidden?
Seems to be so. I have also reproduced and got the same behavior like this. Sorry, not very familiar with SSIS project. But according to some tutorials in google such as this
Blog : Building your SSIS project in Azure DevOps It not appears, but we also able to build it through Azure DevOps.

How to rename C++ source files in Visual Studio 2003?

I have several C++ projects in a few separate solutions in Visual Studio 2003.
I need to rename several of the directories and source-code files in these projects.
How do I rename directories and source files such that VS will recognise the new names?
If I change file names in the OS, VS ignores them. It still shows the old file names in the Solution Explorer, and double-clicking those produces an error message (something like "Could not complete the operation").
The Solution Explorer doesn't seem to provide any way to rename files.
I can select a file and see properties such as what file-system path it points to, but I can't change any of those properties.
I'm not using integrated source control.
I solved the problem in a few ways.
If I rename a directory containing a project used in a solution, I can either edit the SLN file directly, or open the solution in Visual Studio, then remove and re-add affected projects.
If I rename a source file used by a project, I can edit the VCPROJ file, as this contains the paths of all source files in that project.
I also had to check all projects for "Additional Include Directories" and "Additional Library Directories". Some of these referenced renamed directories.
I eventually fixed most of these using a separate text editor's "Find in Files" function to find directory references. This was faster than using the VS UI to check properties of each project.

TFS 2010 cannot add solution

We are trying to add a VB.NET 2010 solution to a Team Foundation Server 2010. When we right-click the solution and select "Add Solution to Source Controll..." it pops-up a message "The file 'sample.vb' cannot be added to the source countrol because the item has no source control mapping. If you choose one of the Ignore options the operation will continue without addint the file."
We wonder what the reason for this is.
We found that the file in question was a linked one and not part of the project itself. The rest of the files went in the TFS without any issues. So, you were right that the file was outside of the main project folder.
You need to make sure that the file is created in a directory that is mapped to the current TFS workspace.

Can't manually add files to TFS

We use Codesmith to generate some code, and when we open up the projects, the files are there, in the solution, but there is no way to check them in. The DLL compiles just fine. The only difference to the .csproj is the addition of any new files we generated.
But unlike VSS, TFS, does not detect these files. I validated this behavior by editing the .csproj manually. For some reason, the only way to add a file to TFS is through Visual Studio.
However, when I remove them from the project, and then include them, I get the usual yellow plus sign.
You can manually add files to Visual Studio, however changing your project file isn't the best way to do this. If your project is already under source control and the files you want to add are visible in the Solution Explorer window, you can simply right-click a file and select Include in project. The next time you check your code in, the items will be added.
Since you're using TFS 2010, check out the Team Foundation Server Power Tools extensions. This includes the Windows Shell Extensions which give you integration into Windows Explorer which let's you right click on files or folders and add the to TFS outside of Visual Studio. Very nifty!
Looks like it is not possible and the workaround is to batch-add all the files through PowerTools. Though this article/forum-thread is dated it appears to be helpful:
Adding CodeSmith generated source file in Team Foundation System

Why do empty folders disappear when adding Visual Studio solution to TFS?

I have this Visual Studio solution that includes a project that has a template folder tree consisting of several empty folders. When I add this solution to Team Foundation Server (TFS) using the "Source Control -> Add Solution to Source Control" menu item it doesn't add the empty folders to the TFS repository! I really need those folder to be present when the code is downloaded from TFS.
Now, I know I can create the folder structure using Source Control Explorer, but since the whole project is managed from within Visual Studio it feels kinda wrong to create these folders in a separate way.
Is there some setting I need to adjust so Visual Studio will also create TFS folders for empty project folders?
Apparently it's a feature, not a bug:
"in the Add files to source control we
do not support the addition of empty
folders, but in our research our users
preferred the SCE toolbar button for
actually creating their empty tree
structure rather than going to the
file system, doing it there and then
adding to source control."
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=119974
In TFS2008 you can drag and drop folders from Windows Explorer into source control explorer, and empty subfolders will be created when checking in. Not sure if this works in TFS2005, I don't have an instance handy to test it - anyone?
Drag and Drop folders worked for me on TFS 2008, although it didn't on TFS 2005.

Resources