Team Foundation Server find a folder - tfs

Hello, I am struggling to find a folder in TFS by search.
Is there any way to find not only code but folders and file names?
Thanks!
UPD: I don't see this folder in the search result.
I am using (TFS2017)TFVC as version control and the Web/VS2015 as a client.

For TFS 2017, you can use Code Search if it's been configured by your TFS admin.
For earlier versions, the easiest way is going to be to grab a copy of the source code to a local workspace and then search via the Windows file explorer or via a quickie PowerShell script.

Install TFS Power Tools.
Menu Source Control > Find > Find by Wildcard ...
Enter file or directory name.
Based on How to search for a specific file in the source control of TFS inside a particular selected project?

Related

TFS - Versioning file in a drop folder

We currently use TFS 2010 for controlling some of our .NET projects.
I'd like to know whether it's possible to provide some kind of versioning within TFS for a specific folder on a network share for example.
The idea being is to control release packages (zips) for every release we do. As this bit is done by some other person (not technical and he doesn't use Visual Studio or any tech tool), it'd be great to streamline the process of versioning the zip files for every release.
Technically speaking:
We've setup this folder \servername\releasezips and every time I drop a file named release.zip, it would automatically commit (push) this file to the TFS server (no comments needed) and furthermore, once the file contents change (meaning that someone dropped another version of the file in there), the system would again push the file to TFS, but with a following version.
Is this possible somehow? I've seen somewhere that I could programatically have some extra control over TFS, using REST API.
Thanks in advance!
Thanks for your tips, Daniel and PatrickLu-MSFT.
As I said, I did want something straighforward, some kind of control similar to what box.com provides, where you associate a local folder on your machine with the cloud. So, once you drop files in the local folder, the small box client synchronizes it along with the cloud. If access the box.com, I can see the different versions of that specific file.
So what I did was, I've created a small .NET app to monitor the folder and any new files dropped in there would get checked in to our TFS server, by using the tf command line (of course ignoring work items or comments).
So, progamatically within the .NET app, it builds up the tf required commands for processing and versioning the recently dropped files and therefore, executes them.
By the way, I could have used the Team Foundation API in order to do the same job, but it would demand way more effort.
Cheers
According to your description, you want to commit/check in files during the build/release pipeline.
It's not a recommend way to check-in generated build files and modify source code during a build pipeline. If you really want to do this, you could edit the build workspace files and use tf commands in custom activity and call the powershell eq:
cd $env:BUILD_SOURCESDIRECTORY
$TFFile = Get-Item "C:\Program Files (x86)\Microsoft Visual Studio 1x.0\Common7\IDE\TF.exe"
$tfOutput = [string]( & $TFFile.FullName checkin /noprompt /override:"***NO_CI*** New version is $newVersion." /comment:"***NO_CI*** New version is $newVersion." 2>&1)
Another way is installing TFS Power Tool and use the Windows PowerShell Cmdlets to check in the files. Refer to this link for more details: PowerShell and TFS: The Basics and Beyond
For version the dropped files, you could take a look this similar question: TFS Build Copy to Versioned Folder
Basically, you have to customize build definition with custom activity and based on build.buildnumber variable to generate/create .zip file.

Visual Studio 2015 - Merge tool button missing

I'm having problems with merge tool in Visual Studio 2015. I didn't need the merge tool for the longest time, I haven't used it for couple of months. Now when I need it I can't find it. I was trying to google and find an answer, checking VS settings but with no success. I can only see buttons 'Overwrite Local File or Folder' and 'Keep Local File Contents'. When I press Compare button, I see diff tool but I'm not able to accept changes (check buttons are missing).
What am I doing wrong? How can I merge two files?
Please navigate to files in source control
Right click on file/folder you want to branch>>Merge
Full list of other solutions.
This is because these files in your local folder are not been tracked by TFS Version Control. For example, you added a file "readme.txt" in you local folder and hadn't check-in them into version control. Another people in your team also added this file in the same relative path and checked it into version control. Now, when you get the latest version or check in your changes, you will get the behavior as your screenshot. A similar question can be found here: TFS Conflict Type: Writable File - A writable file by same name exists locally
It's doing exactly the same things in Visual Studio 2017.
If you had a problem in workspace and you rollback it from a save, you can have the same issue.
You need to rebind some of the project by yourself first like the asked question here : Re etablish TFS source control bindings, then if all is going well you will see the button.
If it's not working, try to use external merge tool which will allow you to edit thoses files.

Access/Find project folder in TFS 2010 build

What I want
I need to find out the project folder paths in a solution (.sln) during TFS 2010 build.
Why I want this
I need to search for files with extension ‘.mc’. These files are present in project folders.
Why not use solution path variable in TFS 2010 build
I cannot use solution path variable. The reason for this is that my solution path contains 100 folders, each containing files with ‘.mc’ extension. The solution (.sln) only contains 10 visual studio projects, each in its own folder. I want to search for files in these project folders.
Is there a simple solution that you know of? Thanks in advance.
Use the InvokeProcess activity, combined with the FIND command line utility on your solution file
I don't think something out-of-the-box exists for something like that.I would go for a custom build activity (see here for a classic resource on that), that works along the lines of crawling the SLN in order to retrieve the file paths.A possibly useful resource on that could be this post, but, since you are also using TFS as source control, it might be a good idea to search for SccProjectUniqueName: each line of the SLN containing this - has a path to a project.

How do I export my source from TFS for import into CVS?

TFS version is 2010. CVS version is 1.11.17.
You probably want to look at the TFS Integration Platform. You should be able to setup a 2-way sync of source so that both are kept up to date.
I don't think CVS is supported out-of-the-box, but there should be someone who has written an adapter.
There is a tool from Timely Migration that should integrate with the TFS IP.
CVS is really a step back, but ok ;)
If you don't need any file history, it's very simple to export your source.
In VS2010, open View / Other Windows / Source Control Explorer.
Than open the drop-down "Workspace" and select "Workspaces ..."
There you can add a new Workspace, where you also can select your local folder to which you want to export the TFS source files.
After that you can click OK and retrieve the TFS files you want to the selected local folder.
The next step is to import all in CVS.
That's all.
EDIT:
I found a software tool that claims to offer source code migration from CVS to TFS. Perhaps it's worth to try: http://www.componentsoftware.com/Products/Converter/index.htm

Does any tool exist to help Sync a directory with TFS?

When using TFS with a tool outside of Visual Studio (Specifially ORMS), modifications to the project file to include a new file will not cause the file to be added to source control.
Does anything exist that could potentially say "Warning: You are about to check in change to a project file which include a file which is not versioned"
In addition to Martin's answer, the latest release of TFS Power Toys includes:
"Windows Shell Extension (NEW!)
Allows core version control operations within Windows Explorer without using Team Explorer."
So you may just be able to commit those new files without having to fire up Team Explorer or use an MSSCCI compliant source control client.
Not quite, however you might want to download the TFS Power Tools and check out the command line utility tfpt.exe.
The "tfpt online" and "tfpt treeclean" might be most useful to you when working outside of an integrated TFS client. tfpt online will look for files in your local directory that are not under version control, treeclean will show you files in your local directory that are not under version control so that you can remove then if they are not required.
Good luck,
Martin.
One gotcha I've found using tfpt online is that it doesn't always pick up changes unless you use the /diff switch. That one caused us all kinds of headaches with our automated build until I realised what was happening!

Resources