How to add an existing project to TFS - tfs

I have a solution with 6 projects already in TFS. Each project is in its own folder.
I right clicked the solution and added a new project, so the solution XML knows about my new project.
I checked in the solution file, but the newly added project is not listed in the source control explorer, presumably because I never checked in the files.
My question is how can I check in the project and ensure that the new project files go into its own folder?
If I right click in the root of the solution and select the new project files the "Destination source control folder" is set to the root - do I need to first create a folder in TFS which matches the name of my project folder? That seems backwards.

Sounds the solution is not in source control when you add the new project. Normally the new project will be created in the solution root folder and the files will be added in source control automatically if the solution has already been in source control.
So, please open the solution root folder with Windows Explorer to check if the new project exists in the workspace (solution root folder). If the project exists, then follow below steps to add the existing project in source control.
Navigate to solution root in Source Control Explorer
Right click in Source Control Explorer and select Add items to
folder
Select the Project folder you have created, then Next
Select items to add or Excluded, then Finish
Check in the changes

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.

Confused about adding an existing file to Team Foundation Server (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?

Add solution to different TFS team project

I've accidentally added my solution to wrong Team project on TFS, I've gone to File/Source Control/Advanced/Change source control, I've selected all my projects and unbinded them, went to solution, and after right click I've chosen Add Solution To Source Control, but pop-up appeared saying:
The item 'ProjectName.sln' is already under source control at the selected location.
If you are trying to rebind a project that you have already added to source control
outside Microsoft Visual Studio, you should use the Change Source Control command. If you are
adding this project for the first time, you should either choose a different server folder for the project or move the
existing project to a different server folder.
I've tried to bind project to new Team project, but when I tried to check in, not whole project was checked but only changes added since I've accidentally added it to wrong Team project.
To sum up how can now I add my project to TFS source control ?
You need to unbind it, then manually move the files into a local folder that is mapped to the correct team project. Then try doing the Add Solution to Source Control.
Each team project will be mapped to a different folder in your local workspace. If your files are under the folder for project A (which I assume they are if you've already added it to that team project), then you need to move them to a folder under Project B before trying to bind to Project B.

I made a mistake in my source control mapping. How do I correct it?

I created a team project, say ProjectA
When I mapped it to my local folder, I found that the root server folder: ProjectA folder is not mapped. However the ProjectA folder within that IS mapped to the project. This is a problem as the BuildProcessTemplate is not included in source control and I cannot build my application.
How do I remove the mappings and start again?
On the source control explorer window in visual studio there is a drop down near the top for workspaces. When you originally mapped that folder, it created a workspace for you. If you want to change the mappings, it can be done by clicking the drop down and selecting the Workspaces... option. You can select your workspace and then click Edit.. to change mappings. You can also delete your current workspace and create a new one if you feel so inclined.

Adding Sub Folders to Content Folder

I want to add folders/sub-folders/files to the content folder of MVC3 project. I added some folders with sub folders and files to the Project Directory of Contents Folder in Explorer. However, when I try to add them in visual studio, it will not let me add the folder and its sub contents, but keeps navigating to the files in those folders. Why can't I just add the folder, and its sub folders with files. It only allows adding the individual files to the Contents root folder and does not create the folder structures. I want to maintain the folder structures in the Visual Studio Project, but can not.
in VS2012 and others, make sure that you have the option "Show All Files" selected in your Solution Explorer. This will show all the content, subfolders and files in your project.
If your using any source control, ensure that you 'right click' on the folders or files you want to add and choose "include in project" from the pop-up menu.
The reverse of this also works to "exclude from project".
I ran into this issue myself, when first getting into VS, and got quite frustrated at adding content through Windows Explorer, but not being able to see that content appear in the Solution Explorer.

Resources