Webstorm remote file path is not mapped - tfs

I have set up a project from a TFS server account. After mapping the required folders for my development, i have created a project on Webstrom and then configured the TFS (with TFS plugin) to work accordingly.
I can sync and get files easily, however, once I try to write on the files (since it's all read-only till used), an error saying: "Cannot edit file(s): Mapping not found for files:"

Test pass in my lab environment(Webstorm11.0.1 TFS2015).
Just right click the file in project, select TFS -select Edit. After doing this ,it will check out the file from TFS server automatically and be editable.
Could you still see your mapping workspace under 'Manage TFS Servers and Workspaces'and your project under Working folders?
Below is my personal settings for your reference:
Make sure three things:
You are working on the Server workspace.
The status of the working folders should be Active.
Your TFS server account have the edit and check out Permissions of this project in TFS server.
If it still doesn't work, please check the log (Help-show log in..) whether contains any clues.

Related

How to get changes from other users in VS Code from TFS

This question is for building Angular application in VS Code.
My team has been coding in VS2015 and using Microsoft TFS for version control (Please note that our code is within the company firewall, on a local TFS build server and not on Gits repository). For Angular, I installed VS Code and Azure Repos plugin for TFS.
Once Work-space is setup, I can see the files (I downloaded the files from VS2015 on local machine) but they all show as "Untracked" changes - why? These are checked in files.
Also, when a colleague checks-in files from their VS Code instance, my VS Code doesn't get it.
What is that I am missing here?
I figured out the issue (or a workaround). Posting my solution for any newbie facing the same issue:
Please note that my code is not in GITS or any remote repository, it is in Team Server hosted in the company data center.
I have a workspace created in VS2015 via which I mapped my Angular code and downloaded it on local machine.
VS Code Settings:
Make sure you have Azure Repos extension installed.
Go to File->Preferences->Settings (make sure User settings tab is selected)-> Extensions-> Azure Repos extension:
Provide the values for following fields:
(a) Tfvc: Location Example value for VS2015: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\tf.exe
(b) Tfvc: Proxy
Example (this should be your team server name): https://dataCenter.myCompany.com:9100/tfs
(c) Tfvc: Restrict Workspace (this is optional, use only if needed)
Check the box
Goto View->Command Palette-> type Team: Signin, provide username and password.
Goto File->Open folder-> select the folder mapped via VS2015.
Once the folder is open, you will see all files inside the folder. Go to File->Save Workspace As and give it a name.
Now you should be able to see any changes done by you in either VS2015 or VS code. Check-in should reflect the changes for you and other users connected to the code.
Previous Mistake: I realized that I was using Gits:Initialize Repository (as advised on various sites) which was causing all the trouble of "Untracked" changes and other users' changes not reflecting in my code.
Thanks,
RDV

When connecting to a project in TFS block local repo

In Visual Studio 2017, How do you connect to a TFVC project in TFS and prevent it from creating a local repo? I want to be able to copy files from another project in VS 2017 and check-in but not have all the files from that project local?
In the source control explorer, drill down to the project folder you want to add the files to, right click on the folder (you don't have to have it checked out) and click "Add items to Folder".
You should see an "Add to source control" dialog that is showing files from your local computer. From there, it's not too hard to follow.
When you connect to a TFVC project in TFS you could select to create local workspace or not. But we could not restrict users to create local repo or not.
If you do not want others to pull files from server to local, you need to use permissions to do the restriction.
You could directly copy files from another project to your local workspace, VS will auto detect changes and list in the pending change list. You just need to check in files.
More ways about how to add files to the server, please review this official tutorial.

TFS 2015 Build is not getting the Mapped path

For some reason my build definition are not working properly if long path mappings. If I were using the path $/Project/Samples it works OK.
My build has this in the repository tab:
Then the logs show that there is no SLN found, and I confirmed that nothing was downloaded to the agent working folders:
For me it's a bug when getting sources, as I can't see a good why it is not getting correctly the files. I already tried to add files in some folders above and it works. Some ideas?
This permissions issue must be addressed at both the Team Project Collection and Team Project scopes.
First, the Team Project Collection:
Browse to http://[my_tfs_server]:8080/tfs/[my_collection_name]/_admin/_security?_a=members (your Collection's Security admin tab)
Click on the TFS group "Project Collection Build Service Accounts"
Ensure the user (not group) "Project Collection Build Service (TEAM FOUNDATION)" is a member of the group
If it is not a member, add it with the "Add Windows user or group" menu, then Browse -- you should find it in the list of users
Second, the Team Project:
Browse to http://[my_tfs_server]:8080/tfs/[my_collection_name]/[my_team_project]/_admin/_versioncontrol
Ensure the user (not group) "Project Build Service (TEAM FOUNDATION)" is present in the security list (along with the "Project Collection Build Service Accounts" group)
If it is not a member, add it with the "Add Windows identity" menu, then Browse -- you should find it in the list of users
Third, ensure that the "Project Collection Build Service Accounts" group and "Project Build Service (TEAM FOUNDATION)" user have appropriate version control rights, such as Read and Label. Make sure that Inheritance is set to On.
With these permissions in place, the -1 issue should resolve.
"workspace version -1" usually occurs when there is no permission to access to the source control. Check the "Inheritance" settings for the folders in your source control and make sure it is set to "On". Refer to this link for details: TFS 2015 Build Agent failing syncing the repository.
Similar question here: TFS 2015 build agent failing to sync TFVC.
This maybe a long path error. A way to fix this issue is to reset the workfolder path.
The default work folder location is a _work folder directly under the
agent installation directory. You can change the location to be
outside of the agent installation directory, for example:
/WorkFolder:C:_work. One reason you may want to do this is to avoid
"path too long" issues on the file system.
Source link
And also set Clean = "false". This may also be the root cause. If you have set /Project/Samples and build the definition. It will pull down all files under /project/Samples. Set the long path again, there has been files in the working folder. TFS may not get the new files. Set Clean= "True" and try it again.

TFS Folder creation and update permissions set to readonly

Over the last several months myself and those on my development team have run across a new issue. When TFS creates a folder or does a 'Get latest' and overwrites any of the files in the folder structure, it changes the folder permissions to 'Read-only'. This causes an issue, an inconvenience really, where when we go to build the project it will tell us that our access to those folders is denied. If we open the folder and un-check 'Read-only' we are then able to proceed with the build and/or publish of the solution.
We have checked with our networking department, this is not a network setting and is not occurring anywhere outside of TFS. This is only occuring when TFS creates the folder.
Is anyone else having this issue? I've been pouring over settings off and on, trying to determine if I can change this setting. I do not want the folder to be read-only when it is generated or updated.
This is by design but your inconvenience is not. In TFS 2012 (with VS2012) Microsoft introduced local workspaces that do not put anything as readonly.
You can go to the settings of your workspace and change it from server to local any time.
You are also making a common mistake in that you have files that change during a build under source control. If you remove those files you will be able to build even with server workspace.
It is bag practice to put files that you generate under source control.

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.

Resources