60

I use Visual Studio Team Services to store the source code of my projects as I work on them, I love the service, especially that it is free, but I have been running into the biggest pain lately.

Randomly when I go to save, modify, check in check out I get this error for every single file I am modifying. So if I am trying to save changes to 8 files I get this message 8 times and it takes 45 60 seconds of trying to check out for each file meaning to takes 6 - 8 minutes for the errors to stop (even if I hit cancel).

The local data store is currently in use by another operation

I looked it up online and found many people with the same issue but the response from MS has nothing to do with my situation.

http://blogs.msdn.com/b/phkelley/archive/2013/05/31/tf400030-the-local-data-store-is-currently-in-use-by-another-operation.aspx

It basically says this can happen when you have to many files in your workspace or have several large solution open at once.

This does not apply to me as I usually only have on solution open at a time and my projects are very small (400 -500 files).

gitsitgo
  • 6,589
  • 3
  • 33
  • 45
QBM5
  • 2,778
  • 2
  • 17
  • 24
  • 1
    I got the issue too. The only thing I can do is close VS and open again, everytime when I want to check in files. Even a single file. It only works within few minutes after VS started. Then the problem will come and need to restart VS to check in file. Very annoying and unproductive. – TPG Dec 19 '14 at 07:27
  • 1
    Still happening or had a regression in VS 2017 with the latest update. = – StingyJack Jul 12 '17 at 11:32

9 Answers9

61

Ran into this issue as well on VS 2013 and TFS - every time I opened my team explorer it would take 10+ seconds to show all projects, then when I would expand the project in source control, another 10+ seconds would roll by.

Earlier today I began to experience the "local storage is being used" error when trying to save data in class files. I did some original research, and this following link saved the day for sure. Now TFS is blazing!

Local Data Store Solved

What you do is edit workspace (including all projects associated), and change the "Location" dropdown from "Local" to "Server". It took about 4-5 minutes for the changes to finish, but well worth it.

Hopefully this will help someone down the road.

Rob Scott
  • 7,921
  • 5
  • 38
  • 63
  • 4
    Honestly, I purchased a new computer over the holidays, installed a fresh version of vs 2013 on it and haven't had the issue since, so I can't test if this is the solution or not. But I will mark it as such as buying a new computer isn't the solution most are looking for. Thanks a ton! – QBM5 Jan 16 '15 at 18:05
  • Having your workspace on the server, how does that work? Surely you need it locally to build? Maybe I should test it out before commenting, but my initial curiosity got the better of me :) – Radderz Aug 06 '15 at 11:34
  • 4
    This link shows the difference between local and server workspaces. In most instances you want to use local as there are more benefits. If you are having significant performance issues, you can delete the local project and then perform a new get to clear out the historical changes (which is where some performance issues come in). If you work in an active team on the same project, you really want a local workspace so that you merge files instead of checking them out and locking them for other people. https://msdn.microsoft.com/en-us/library/bb892960.aspx – Radderz Aug 06 '15 at 11:50
  • 1
    Do to the ridiculously amount of projects I have to be involved in maintaining. THIS is the best solution for me "Your workspace contains more than 100,000 items." Thus Server saved me from jumping out the window waiting just to add a new file etc... insanity for local with too many items.. – Tom Stickel Oct 08 '15 at 19:54
  • 1
    This is perfect answer for big solutions! I'm working with solution with over 50 projects and many branches. Before the change simply adding or even opening a file took long seconds. VS was completely crashing on opening XAML files and waiting for "Pending changes" to update took minutes sometimes. Now it's blazing fast. Thank you. – Episodex Jan 19 '18 at 09:35
  • I found the post [Decide between using a local or a server workspace](https://learn.microsoft.com/en-us/vsts/tfvc/decide-between-using-local-server-workspace) useful for the pros and cons between local and server workspaces. – Daniel Ballinger Feb 28 '18 at 23:50
  • I had to choose 'Manage Workspaces' and click on 'Edit' and then expand 'Advanced>>' to get to the screen shown in the link mentioned. – Vijayanand Settin Aug 19 '21 at 22:11
5

Lately I started to get same error message and Visual Studio started to work very slow with TFS and nuget. I have tried repair and uninstall but not solve the problem. At the and it was so painfully slow that I cannot continue working. (Expanding one item on source control explorer takes 10 seconds)

Here is my story and how my problem be solved:

I was mapped tfs folders separately not to get whole TFS because there are lots of irrelevant documents. After trying lots of fix suggestion, I thought this might be the problem because I did this separate mapping first time while I have been using TFS. I generally map and get all items at once and never met this issue before.

I removed all mappings and it was like magic. Error is gone, slow TFS source control is gone and it is rocket fast now. Just to be in a safe side I also delete my workspaces and create a new one and get all TFS items at once.

Levent Sezer
  • 601
  • 1
  • 8
  • 10
5

I found the error would be triggered when I had more than once instance of VS 2012+ running utilizing Source Control Explorer, Solution Explorer and/or Team Explorer windows. I've not had this problem when running a single instance of VS 2012+ (on updates 2+) utilizing Source Control Explorer, Solution Explorer and/or Team Explorer windows in tandem.

I found this article and gave it's suggestion a shot: to prevent multiple threads from accessing the data store simultaneously. http://blogs.msdn.com/b/phkelley/archive/2013/05/31/tf400030-the-local-data-store-is-currently-in-use-by-another-operation.aspx

This proved to be a remedy for this issue.

I would add for other users with large file repositories, using source control and share this issue, it may be greatly beneficial to create multiple workspaces for each of your branches/repositories. I found that by doing this my queries to TFS sped up immensely and also helped with this error. I found this suggestion here: http://blogs.msdn.com/b/phkelley/archive/2013/05/30/using-multiple-workspaces-with-visual-studio.aspx. I share this as users mention TFS running slowly.

CodeLocked
  • 85
  • 2
  • 9
4

I did as mentioned below and TFS started working fine

  1. Close all the VS instances
  2. Go to: C:\Users[UserName]\AppData\Local\Microsoft\VisualStudio\15.0_46af8b8e
  3. Delete the privateregistry.bin file
  4. Reopen the project solution

Above worked for me.

Amit Choudhry
  • 77
  • 1
  • 1
  • 9
3

I also started getting the same error this week. Maybe there's something wrong with VS Update 3?
Simply could not work on any of the projects of the "broken" local workspace anymore.
VS would show all files as being checked out, but none were really.
Other local workspaces were working fine.

I tried removing a project from the workspace, but when trying to confirm it, I would receive the same TF400030 error again.

Suggestion

If nothing else works, you might want to try this: simply delete the whole workspace and create it again, this time separating projects into different workspaces. This worked for me.

You'll probably want to back up your files first.

Caio Campos
  • 339
  • 5
  • 10
1

Had the same problem,can be fixed in 3 quick steps:

  1. Remove current Workspace: Source Control Explorer->Work Space ListBox->workspaces... and remove the workspace.

    - Make sure that all pending changes are checked in

  2. Delete Workspace local folder.

    - Its Better to delete the folder entirely.If eventually keeping some folders make sure to delete all $tf folders (hidden folders inside the workspace folder)

  3. Remap the projects you need ( the less the better )

Hopes that helps.

RoyMalka
  • 76
  • 7
0

In my case the cause was a compressed folder containing my local data store, shown in blue in Windows explorer. Removing the compression did the trick.

Phat Phuc
  • 107
  • 2
  • 8
0

I ran into this error when renaming my workspace. After changing back to original everything worked fine again

user3838018
  • 305
  • 3
  • 14
0

Restarting the Visual studio resolved the issue for me.

Nagaraj Raveendran
  • 1,150
  • 15
  • 23