Can't manually add files to TFS - 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

Related

TFS not tracking changes if items added manually and not included into vs2015 solution

I've added a folder with asp.net core project which isn't supported by Visual Studio 2015 (which is used for everything else) and thus not included to the general solution.
To have those files in source control I had to manually add them using "add items to folder" command in source explorer. So they are checked-in but tfs not tracking changes for them anymore although there are differences that are shown if compare to the latest folder on the server:
How do I make TFS track them and show pending changes for edited files?
According to your description, looks like these files are all out side of Visual Studio.
Not sure if you are using server workspace or local workspace.
When adding or editing the workspace you click Advanced >> . There is a setting of Location: Local/Server.
For local workspace, when your script or anything else changes files outside Visual Studio, your workspace detects the changes automatically.
It also detects adds or deletes but you have to include them to your Pending Changes manually with the link under Excluded Changes.
For server workspace, you could choose to use Reconcile command. See https://stackoverflow.com/a/22860674/932282 for a complete answer.
Besides, you could also take a look at other solutions in below similar question:
How to have TFS 2010 detect changes done to files outside of Visual Studio?
Force TFS to detect changes
I think you just added them to source explorer and not to the solution, as you said. In this case, there is no editor application (even your VS) that is responsible for doing the check-out operation because they are not aware of TFS. On the other side, TFS can detect that changes have happened to the files but can not track them.
If you do not activate the "Get the latest version before check-out" option in your team project, then you can go to the source control and check-out those files manually and then check-in them manually again when your work with them is done.
Please before doing this, take a backup of your source code for caution.

EF Core and Visual Studio 2017: Add-Migration doesn't include new files into TFS source control

Add-Migration generates new files but doesn't include them into TFS source control - they are invisible for Check-in operation and are shown without lock sign on Solution Explorer.
Is there the way to solve it?
P.S. This all happens in project Sdk="Microsoft.NET.Sdk" style. The question can be asked in more wide form: is there a way to "pick up" new files (created without Visual Studio) and include them to TFS automatically?
Have you added the project/solution to source control? You need to add the solution to source control first, after that the new generated files will be detected automatically within the workspace.
Tested on my side and cannot reproduce this issue. Could you provide a sample project for further troubleshooting if that still not work?

Excluded files from tfs still being checked in

I'm currently working on a WiX project and I need to include some files in my project but exclude them from tfs. I need to do this because these files are auto-generated at compile time but they have to be part of the project to be compiled. I thought that I could exclude them from source control by going to File->Source Control->Advanced->Exclude <file> From Source Control but it still seems to be including it in TFS.
Below is a picture of my project and it appears that visual studio is trying to exclude them from tfs judging by the little red icon next to the files I'm excluding. However when I compile it errors out because the excluded files are read only and I can clearly see them checked in by looking at the source control explorer window.
Is this an issue in visual studio or am I doing something wrong here?
I resolved this by closing out my solution and deleting the files in source control explorer. Before when I was deleting them from source control explorer I had my solution open and it was actually removing them from the project file. Seems like when you exclude them from source control via the method described above it should remove them from source control but it doesn't.

Using TFS to manage mockups, other images?

I have a TFS server and I often work from two places. I'd like to have a folder that I just keep my random PSDs, mockups, etc in. Maybe even text file notes, or whatever.
The problem is, when I "Check in" a project, it only includes files that are included in the solution. Is there a simple way to have a folder always included?
For instance right now I just have a "mockups" folder in the root of my Team Project (above any individual project folders), but it's not part of any project or solution (I don't really want to publish a few megs of PSD files every time I publish my project).
You can create a Solution folder in your Solution and add the files as an existing file.
(or what is a solution folder)
Do have the psd and mockups something to do with your code?
If not I wouldn't recommend to add the files to the solution.
I would use the Windows Explorer AddIn from TFS Power Tools.
With it you have the ability to checkin/add/checkout files without Visual Studio, you only need to map a folder to your source control.
You can choose on the pending changes window whether you want to have all files checked in from your workspace or from your solution.
See How to show pending changes only for the currently opened solution in Visual Studio 2010 (TFS) and not the complete list of all changes? for a screenshot.

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