Can not add code to a repository in TFS 2018 - tfs

Hey guys!
I am trying to upload my project to our TFS server and then my intention is of course to build it...
The thing is: When I go to Code->project_name and I click on "Upload files" it only adds the files in the current folder. I know it can't be the case that I have to create tens of folders and then add the relevant files to it as shown in the original folder.
How do I do that without uploading all of the files? the build fails if I only upload a .sln file.
I am totally new to is so I really don't know how to use it...
I tried to do it via the VS but It gives me some weird errors.
Any help would be appreciated.
*Using TFS 2018.
Thanks!

If you're using TFVC, map a workspace on your machine and add the code there, then check it in.

Related

Xcode not SVN commit not clickable

I'm having a problem with my Xcode
I set my svn settings in the account settings seems to connect just fine
then I want go to the project I want to commit to the server when I click on source control the only clickable thing is checkout. I tried this like 20 times. It just creates a map with the name of the SVN server that's it.
Does anyone have an idea what I'm doing wrong here?
It seems like you are just creating the appropriate folder for it but not putting your project in it.
Try this. do the checkout again like you already did before, then locate the project you want to sync with your SVN, place it into the folder that was created when you used the "Checkout" function. Now open your project again from within this folder. You should be able to commit/push/pull etc. your project now.
Hope this helps.

TFS 2012 : The working folder is already in use after Hard Disk Format

I have referred to a lot of forums and also this so question but my problem is that I have formatted my machine. So I'm not able to overcome this issue. I have tried deleting workspaces from visual studio command prompt and also clearing cache, but I feel this mapping is more on the server-side than local cache, because my machine was formatted. I don't know which file has this old working path saved.
Also I have tried downloading the project into a new working path. I was able to download, but then I don't get the TFS icon against each file. i.e.it's like working offline (disjoint from TFS database). On right click we generally have an option to return online or go online. In this case on right click I get TEAM -> Apply Patch & TEAM -> Share Project
Please help me with this.I had the same problem in my asp.net projects, when I simply downloaded them onto a new working path it worked fine. But this java project in eclipse just doesn't seem to connect to tfs when downloaded into a new path nor does it allow to download in the old path.
Please not I have formatted the machine.So my case is different, so this may not be a possible duplicate of other SO questions.
I did not disconnect or delete workspace before a format(due to lack of knowledge) at that point. May be doing that would never cause this.
All I did is check in all files and re-formatted my windows.
I'd suggest using the (free) tool TFS Sidekicks: http://www.attrice.info/cm/tfs/
This will give you a GUI to view all workspaces (across all users and machines), and delete the obsolete ones.
This is stored on the server, but the tf workspace command should be able to remove it for you. You will probably need to supply it with the correct machine name to find it:
tf workspaces /computer:* /owner:domain\jesse.houwing /collection:http://yourserver:8080/tfs/DefaultCollection
Find the missing workspace (the one that was formatted) and remove it from the server:
tf workspace /delete /collection:http://yourserver:8080/tfs/DefaultCollection workspaceName;domain\jesse.houwing
Do not confuse tf workspaces /remove and tf workspace /delete, the former only removes the registration from your machine, the second removes it from the server.
Or, if the computer name and the username have stayed the same, edit the workspace and delete the paths no longer valid (or update them to their new location) by changing the workspace configuration. Use
tf workspace workspaceName;Owner
to open the dialog to edit your current workspace.
Or use
tf workspaces /updateComputerName /updateUserName
To reassign the workspace from the old computer (iinstallation) or user to the new one.
I tried using the TFS sidekick tool, but even then, ran into access denied error. Then I had to manually clear off the files from this path:
C:\ProgramData\Microsoft Team Foundation Local Workspaces
So this can be alternative, if you do not want to install a tool or your company does not allow you to install software from unknown sources on your laptops due to policies.
This already has a marked answer but my problem was solved without command line or additional software.
I had just recently updated to '15 and I was migrating my workspace folder to another drive as it was getting too big. The error being uninformative as it was, still appeared even after I deleted the workspace it cited...or so i thought. Both VS'13 and '15 by default made the same named workspace but one for each version. I had to reopen '13, and delete that workspace then move back to '15 where it would now let me remap my folder.
Hope this helps someone.
logout from previous user and login by new user.
Copy Project Folder to Another path.
In team Explorer Right click on project and Remove mapping.
Remap Project
go to Control Panel --> User Accounts --> Manage your credentials --> Edit tfs User Name
user name : your TFS user.
I solved it like this.
I had the same problem.
TFS workspace manager throw me this error:
"The working folder \PATH\ is already in use by the workspace my_computer_name name_of_previous_user on computer my_computer_name"
I solved this problem by creating user in TFS server and deleting the previous one.
U can go to TEAM> TEAM PROJECT SETTINGS > SECURITY.
& if u have permission- create your own user.
This is what I did to get it to work using Manage Workspaces in VS:
Click on Show remote workspaces, delete remote workspaces as I was not using them anyway, not sure if this was needed.
Created a new Workspace B and mapped to another folder Y and choose yes to download all files now.
Deleted original workspace A, mapped to Folder X.
Recreate original workspace A and remap to folder Y (wrong folder) and choose Yes to download all files now.
Delete Workspace B
Edit Workspace A, go to Advanced. At the bottom where it says Wroking Folders, change the Local Folder path back to folder X and choose yes to download all files now.
Not sure if you have to do all those steps but that is what I did to finally get this remapped, only took all day.

Customizing Drop Folder Structure with TFS Team Build

I'm using TFS 2012 to automate a build of a solution which contains multiple windows services and two web applicaitons.
I've used the guide I found here to customize the build process template so that the windows services are put in a folder structure that I like. Specifically:
\dropserver\droproot\MyApp\BuildNumber\
\Service1
\Service2
\Service3
\Service4
This works great, but unfortunately it doesn't work for web applicaitons. If I used the same strategy for those, I just get the contents of /bin for each web app, rather than the full site contents.
MSBuild typically uses the web application targets to handle this, but for some reason, this doesn't work when you customize the build as I have. I no longer get the _PublishedWebSites folder in the build output. (I'm guessing that's because I cleared our the OutDir property of the MSBuild task.)
Has anybody done something like this and gotten it to work with web applications as well?
I think I can help with this, it looks like in the build targets that the published websites folder isn't created if the OutDir is the same as the OutputPath.
So this isn't perfect, but if you add the following into the csproj file in the first property group, you'll get everything deployed into "\bin\deploy\" including the _PublishedWebsites folder
<DeployOnBuild>True</DeployOnBuild>
<OutDir>bin\deploy\</OutDir>
With a bit of customization, this solution ended up working for me:
http://www.edsquared.com/2011/01/31/Customizable+Output+Directories+For+TFS+2010+Build.aspx
Basically, did what that link recommended, but also leveraged a new solution configuration (which I called TeamBuild) rather than conditional property definitions.
I believe the key to making this all work was the passing of the outputDirectory as the TeamBuildOutDir argument to MSBuild. Embedding this variable reference in the OutDir or OutputPath variable was allowed Team Build to build to the correct staging location and then automatically copy files from that location to the drop folder.
I'm going to take this a little futher and get rid of the whole _PublishedWebSites thing, but that will be done entirely in the build workflow.
EDIT: TFS 2013 supports this natively with a simply build configuration option:
Take a look at this thread as this post as well.
Team Build: Publish locally using MSDeploy
Since you need all the files for your web projects, you need to trigger the publishing process, and by tweaking the destination of that process, you can have all of your files copied where you need them.
I think option (2) from his answer will work for you.
I hope that helps.
As I can see in your reference link, it will just compile and package the binaries. It does not deploy the website by the steps mentioned in that.
If you want to get the .html, .css, .js etc. under the _PublishedWebSites folder, you need to do a Web Deployment. This manually we can do by clicking the publish option from right click menu of your VS project and by selecting Publish Method as File System.
But, since you need to automate this in your build and drop it in custom drop folder, you may need to manipulate your MSBuild script by calling a AspNetCompiler task. You can get more information on this at the MSDN link. By specifying the TargetPath while you call this target you can get your Web files deployed at the appropriate custom drop folder.
Happy Scripting.
Have you check this blog, this solved my problem where I wanted customized TeamBuild Ouput Directory.
Customizable O/P with TFS 2013
Customizaable O/P with TFS 2012 and .NET Framework 4.5

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.

TFS out of sync between local and remote - how to "re-sync"?

I have a Project on CodePlex which is using TFS and I am using the TFS Plugin for Visual Studio. Now I have copied this project and worked on another PC without TFS and done some refactoring. Foolishly, I have then just used copy/paste and manual text editing to merge my changes, expecting that TFS just picks up the changes.
Apparantly, that is not the case.
Here is a screenshot of my local directory:
My Local TFS http://img259.imageshack.us/img259/2897/tfslocal.jpg
Notice how some files are missing the lock symbol - those are missing. If you look at the current TFS Tree on Codeplex, there are some files which do not exist locally anymore, i.e. WikiPlexExtensions.cs in the main folder.
Is there any way to easily tell TFS to compare my local to the remote repository and pick up the changes? I could re-add the local files using "Exclude from local project" and re-adding them, and I could create the "deleted" files as empty files just to delete them, but if I can avoid the manual messing around that would be good as well :)
The easiest way is to exploit VS 2008's "online" feature. Basically you want to set your solution offline, then bring it online while connected to the proper Codeplex server. TFS should figure out the rest.
Feature overview: http://msdn.microsoft.com/en-us/teamsystem/bb898913.aspx
Tweaking the settings by hand: http://blogs.msdn.com/benryan/archive/2008/07/09/using-tfs-2008-power-tools-to-modify-server-s-offline-state.aspx
To compare local and server folders, you can check out TFS Power Tool. After installing it, you can bring up the source control explorer, right click on the server folder and then select 'Compare'. Folder difference window will display the differences. You can also right click on the differences to see available commands such as 'Get Latest' to update your local folder for example. Check out Bryan Harry's blog post on the power tool
I don't think there is an easy fix... What I've done in the past is back up those files that I have edited, then do a "Get Latest Version..." for the files I edited. This should change the files back to being read-only etc... Now, check out the files the regular way and paste the backups you had into the checked out files. Obviously this really only works when there are a couple of files you have edited.
TFS (in Visual Studio) has a "Reconcile" command for this, see Microsoft documentation, or this answer with steps.
BTW: This command may not haven been existing at time of original question, but this question came first when I was searching.

Resources