undefeatable TFS error: TF400030: The local data store is currently in use by another operation - visual-studio

No matter what I do, when I touch TFS in any way, it gives me the error:
TF400030: The local data store is currently in use by another operation. Please wait and then try your operation again. If this error persists, restart the application.
Well not everything, I can see a list of workspaces (all 1 of them). But trying to view the workspace in the source control explorer will only show "Working..." Pending changes can only show me there are 654 included changes (a migration, don't judge), but none of the actual changed files and strangely none of the excluded changes.
I tried to nuke this workspace and rebuild it from scratch. But even using tf.exe workspace /delete ..., right after a fresh reboot, will give me the above error.
I tried deleting all VS / TFS related folders from AppData\Local\Microsoft and running devenv.exe /resetuserdata afterwards as explained by Willy-P. Schaub.
Then running tf.exe workspaces results in No workspace matching * found on this computer. ... until starting VS again, after which my workspace is visible again
As explained by Philip Kelly the TF400030 error might be because of a scanner running. But I don't know how to locate / kill such a scanner and no process on my PC is doing any significant IO.
I fear spending the time to reinstall VS would result in this exact same situation and reinstalling my PC seems a bit excessive.
Is there a way to make the TFS client forget about my local workspace? Or even better hunt down and kill whatever other process causes the TF400030?

sigh sometimes the answer is so easy: I just rename the mapped folder on disk and TFS started responding again.

Related

Unable to perform branch, database update error thrown

I am trying to branch a directory in TFS using the Source Control explorer, however whenever I do, I always get this error:
TF400962: There was a database update error. Please try your operation again.
This occurs after confirming I would like to branch after it informs me that it will be committed as a single operation, pending changes will not be created and that it cannot be canceled when it is started.
I have been stuck on this for a while now and I can't seem to find any solution to this, here is a list of things I have tried.
Made sure the Target Branch Name is below 255 characters (As suggested here). I also made sure the whole path on my machine was also less than 255 characters.
Changed workspaces.
Updated Visual Studio to the latest version.
Restarted Visual Studio.
Restarted my machine.
Branched another directory (To see if the directory I need to branch isn't throwing the error).
Made sure connection to the TFS server was correct.
Checked that I had the correct settings in the workspace.
Downloaded the directory I am trying to branch to my PC.
I have ran out of ideas and it really is frustrating me. Any help would be appreciated. I'm using Visual Studio 2017 Enterprise now running on the latest updates.
Check if you had a deleted branch in the path you are trying to branch to.
Steps to reproduce:
Have code at $/path/to/main
Branch from $/path/to/main to $/another/path/dev
Delete $/another/path/dev
Try to branch from $/path/to/main to $/another/path/dev/branch
-> TF400962
Problem seems to be that $/another/path/dev/branch overlaps with deleted branch $/another/path/dev
Resolution:
Show deleted elements in TFS Explorer
Convert deleted branch $/another/path/dev/branch to regular folder
Branch from $/path/to/main to $/another/path/dev/branch
-> Success!
The error you are getting a generic error that could happen because of any TFS SQL Server related issue. Please check events logs on your TFS's SQL server machine. You might find more information there.
There is more information here
https://connect.microsoft.com/VisualStudio/feedback/details/1128642/tf400962-there-was-a-database-update-error-please-try-your-operation-again
Make sure your TFS DB is not out of disk space.

Visual Studio 2015 can't open project.exe for writing. Access to path denied

I am developing a VB.NET (4.5 framework) solution in Visual Studio 2015, Win10 OS, and have been able to run the builds uninhibited for several months, but now I am receiving the following error upon starting the build:
vbc : error BC2012: can't open
'C:\MyProject\ProjR5\ProjR5\obj\Debug\ProjR5.exe' for writing: Access
to the path 'C:\MyProj\ProjR5\ProjR5\obj\Debug\GenTagR5.exe' is
denied.
At first, VS2015 would give me the option to run the last successful build, but even that is no longer an option. After exhaustive internet searches on this problem, none of the dozen or so given solutions are solving my issue.
Here is what I have tried in order to resolve the error so far:
Ran sfc /scannow (elevated prompt)
Using ProcessExplorer, find handle or DLL substring that included my project
Made sure there were no hanging procs (including procs with my project name, devenv.exe, [project].exe, [myproject].vhost.exe, etc.)
Restarted VS2015
Restarted VS2015, running "as Administrator"
Restarted Computer
Full Shutdown of computer
Complete Rebuild of Solution
Build->Clean Solution
Build->Clean Solution, then Build->Build Solution
Build->Rebuild Solution
Uninstalled and Reinstalled VS2015
Disabled all indexing
Removed "Read Only" attribute from entire project folder and files within
Checked startup scripts for like- or identical processes
Disabled all AV apps
Disabled all antispyware apps
Disabled all firewalls
Verified that Application Experience (services.msc) wasn't disabled (I'm using
Win10 ... it isn't even in the list of services)
Set Tools->Options->Projects and Solutions->Build and Run->Max. parallel
builds to 1
Rerun aspnet_regiis.exe (under .NET\Framework)
Checked Local Security Policies and verified account was listed under
"Impersonate a client after authentication"
Removed \bin and \obj folders
Put \bin and \obj back when removing them didn't help
Removed \bin and \obj folders, then Rebuilt
None of these have worked. Any suggestions?
The problem ended up being Samsung Magician's Rapid Mode losing data during its write-caching phase to my solid state drive. I turned off Rapid Mode, and now the project builds without any problems.
Sorry for came too late, but i had this problem and i wanted to show how i fixed for the next devs who need a solution:
It's quite simple, just change your proyect assembly name:1) On your solution explorer: Right click on your proyect.
2) Properties>> aplication>> assembly name>> change it.
3) Compile, run to test it.
4) Change the name again if u wanted the original name.
Adding a description:
Changin the assembly name
New 2 programing in VS but i had same problem of Access or Write exe file ON BUILD.
Problem came out of nowhere. I didn't use or make changes 2 exe file in months,
made exe file, used it now and then and forgot about it....
Then after few months i wanted 2 start exe but no icon on desktop ??? ....tried everything, lost 3 days of searching inside code for error in VS and then called Google....
I read last comment ABOVE which mentioned Bitdefender, opened it and found BitD did block and isolate exe files ..... so i tried exluding files and folders which made problems inside BitD but no help....
So i went back 2 VS.
Within debug i got some X86 processor error which didnt make problem to build but it was warning (free component name in error description helped me ), - errors you can ignore but they are here on build ....
So i made last move before starting it all over again. Removed COMPONENT from application, deleted it on PC ...started VS from start .. and ALL was OK !!!
So in my case it was all about FREE component i used in app inside VS .... Bitdefender found some add / virus in it and blocked build progress.
BitD deleted or blocked exe file in start....
Hope this help anyone with similar problem !
The cause of this error for me was that Team Foundation Server had pulled in a bunch of files to my work space as Read-only. Not sure why it pulled them down from the server with read-only checked, but all I had to do was uncheck it.
Ok. Create a new solution and add its directories to the exception list and copy all your work, except for the '.vbproj' and except for the '.csproj' and the directory files to the directory of the directory of the new solution. I have tried that and it works, due that I have Bitdefender, it will be the only way to sort that issue. After doing so, try to build the app again. If it does not work, then I am definitely out of ideas.

"Access to the path is denied." when attempting to check in files to TFS

I suddenly have begun encountering an error similar to "E:\Websites\Stage\mywebsite\somefile.ascx: Access to the path is denied" on a multitude of my local files when attempting to check them in. The files it is failing on are all sorts of files, PNG, ASPX, CONFIG, etc.
I am using Visual Studio 2013 for Web (Update 4) and the visualstudioonline.com TFS.
The files are stored on a network location and I have a drive mapped to that location. I can manually open, manipulate, and save any of the files that error so I do not believe it is truly a permissions issues.
This setup has worked for months but suddenly it is giving me problems.
I ran a powershell script on the folder Get-ChildItem -Include *.* -Recurse -Path 'E:\Websites\Stage' | select fullname,isreadonly and all the files return 'False' under the isreadonly column. No errors are returned.
I am in need of some further ideas.
I found a workaround in another StackOverflow question.
Essentially, you shelve the pending changes, then you commit it. No need to unshelve them.
I would only suggest to use that to check-in your changes until you set another workspace locally (or someone fixes that issue).
As many other, using Visual Studio 2013 from within a VM having a local workspace located on the host computer mapped through a shared drive was working well before updating to "VS2013 update 4".
That setup was suggested to me with the reasoning that if the VM crashes, then I wouldn't loose my changes.
Storing your local workspace on a network location is not supported and should never be done.
Have a 'local' (physically on your local machine) workspace where you edit the files and check in. Then have an automated build that publishes the files to a location of your choice.
I ran Windows/Visual Studio in Parallels on a Mac and had a project saved to my desktop (yes, shame on me). Internally this path is handled as \\psf\Home\Desktop even if it is stored locally and not in the network. Still gives the same exception and is solved by moving it to your regular drive (c:\...)

Visual Studio 2013 hangs when opening a solution

I installed VS2013 (v12.0.21005.1) and added ReSharper 8 (v8.0.2000.2660) a day or two ago. That day it was fine. Now I'm lucky if I can get it to open one solution in a whole day. It opens OK by itself, but when I try and open a solution from within - via the menu - it hangs, badly. If I right-click a solution in Windows Explorer and 'open with VS 2013', it opens then hangs, in exactly the same way. Every now and again, for hours, I get a little notice that it's busy with something.
Anyone know what could be wrong, before I endure a reinstall that doesn't fix the problem?
Sometimes it's enough to simply delete the ".v12.suo" file and try to open the solution again. Helped me many times when VS2013 was freezing on loading a project.
Deleting all ".suo" files worked for me. There were several copies due to opening the solution in multiple versions of Visual Studio.
Edit:
Possible path could be:
PathToSolution\.vs\ProjectName\v14\
.vs may be a hidden folder.
.suo is filename.
Basically it could be anything, but you can try a few things:
Turning it off and on again.
Clear the ReSharper cache, it's in %LOCALAPPDATA%\JetBrains\ReSharper\<CurrentVersion>\SolutionCaches, where you should find a folder matching the solution you are trying to open. Just close all instances of VS2013, delete the folder and try again.
turn off ReSharper: Tools > Options > ReSharper > General > Suspend
uninstall ReSharper completely and see if problems persists.
Repair Visual Studio through Programs and Features.
I found the following to be the better approach to debugging VS based on MS Connect instructions
Please help to confirm if your captured dump file is a 32-bit dump file. If it is a 64-bit dump file, please use the following step to capture a new dump file.
Start Visual Studio.
Start another instance of VS.
In the second instance click Tools | Attach to Process...
In the list of processes locate devenv.exe.
Click Select... and explicitly choose 'Native' and 'Managed' code.
Click OK and OK to close Select dialog and Attach to Process dialog.
Go back to the first instance of VS and repro the hang.
Upon the hang, control should go to the second instance of VS. If not please go back to the second instance of VS manually, and hit "Break All".
In the second instance click Debug | Save Dump As Minidump with heap.
If you are running the VB profile you will not see the Save Dump As menu item. To add this menu item:
Select Tools -> Customize
Select the Commands tab
Select Debug from the Menu bar dropdown
Click Add Command...
Select Debug from the Categories list.
Find the Save Dump As entry in the Commands window.
Click OK (the Save Dump As... command is added to the top of the Debug menu).
Click Close
You can get detailed steps about how to get the dump file and call stack at http://blogs.msdn.com/debugger/archive/2009/12/30/what-is-a-dump-and-how-do-i-create-one.aspx
If you find the problem is with Resharper Addin you can then report the issue via - http://youtrack.jetbrains.com/issues/RSRP
Suspending Resharper Worked for me.
Goto
Tools -> Options -> ReSharper -> General -> Suspend Now
Now your solution will load very fast.
After your solution fully loaded, you can change the Resharper settings to Resume Now.
Are you using any node modules in your project? Or can you identify that it is a ReSharper specific issue?
If you've got NPM modules (eg. for Grunt), mark your 'node_modules' folder as 'hidden' (no need to make child folders hidden though), and try again.
Visual Studio was hanging on open for me, turned out it was trying to scan deeply nested node modules with file paths longer than the Windows maximum (260 characters), and this was preventing me from opening the solution in VS, but marking the folder as hidden solved the problem.
I had this issue recently as well, and found that disconnecting my computer from the internet when loading the project fixed it. With this, I managed to cut loading times from several hours down to seconds. Since my network cable is not particularly accessible, I simply disabled my network adapter before loading the project (in Control Panel).
This soon became frustrating, however, and I recently looked into the problem again. It seems that logging on to my Microsoft account in Visual Studio ultimately fixed the problem, and I now have no more issues loading projects.
This may work for you as well (if you haven't yet fixed it - but since there is no accepted answer here, I assume that the problem is persisting), so I suggest that you at least try disconnecting from the internet, even if you would rather not enter your Microsoft credentials.
I went into the %LOCALAPPDATA%\JetBrains\ReSharper\
and opened all the directories looking for the SolutionCaches, and emptied all of them. Problem solved. The application was quite large, so this helped.
Check for Windows updates
I had this problem too. Furthermore, I couldn't open my Windows firewall settings (trying to block VS's internet connection).
When opening update settings (Windows 8), I saw there was a pending update ("found today"), so I rebooted my computer, letting Windows update. After that, VS and the firewall worked fine again.
Check your hardware
I've had the problem a second time; even Windows 8's update page would keep loading forever. It was an issue with my (non-OS) hard drive: https://superuser.com/questions/756261/various-parts-of-windows-8-and-visual-studio-2013-get-blocked-by-possibly-comm?noredirect=1#comment978074_756261
I get this issue now and again - VS 2013 Update 2, Win 8.1, IE 11.
Try this - Open task manger, kill the VS app hanging, and then close any IE sessions that are running in the Background Process list - there may be one or more hanging around.
Restart VS
Seems to clear it for me, without a reboot.
The problem I had was the Perforce connection.
When opening the solution, it would ask if I wanted it to connect to Perforce. Allowing it to try would make it hang and allocate 1.5 GB of RAM.
Not allowing the P4 connection let it load properly (allocating 1 GB RAM). Then I could tell it to connect to P4 after, and it is now fine.
For me , whether computer crashes with power outage, or sometimes with mandatory reboots in the middle of the night. What does WORK for me
DELETE ALL FILES IN THIS DIRECTORY:
C:\Users\yourusername\AppData\Local\Microsoft\WebsiteCache\
For anyone still referring this helped me:
I had to always delete .vs12.suo file to load the project.
I came across this thread from Microsoft and following that I created registry entry which fixed my issue with Solution load.
https://connect.microsoft.com/VisualStudio/feedback/details/860685/visual-studio-hangs-after-10s-when-loading-solution-corrupt-suo
I had similar issue, when i checked the solution file it was created by VS.Net 2012. To resolve the issue, I created dummy solution file and reloaded the projects from vs.net 2012.
Also observed when nuget package update got screwed up, while you reload the solution, Visual Studio might get hang.
The Visual Studio might go hang, when there was a problem in loading the nuget packages.
In my case, VS 2013 Professional was hanging on every startup, even without opening a solution because the license was no longer valid.
Last item in the log file:
<entry>
<record>367</record>
<time>2015/07/13 20:11:05.051</time>
<type>Information</type>
<source>UserConnection</source>
<description>myemailaddrs#gmail.com signed in for IDE user</description>
</entry>
And on the msdn.microsoft.com subscription page: "Your subscription is no longer active, contact your administrator."
I had to get an updated subscription from my employer.
Deleting Test Results from my TestResults folder actually did the trick for me. Just another thing to try.
VS2012 hangs on me e.g. when opening a csproj file on a network share (in fact on a share that was on the VirtualBox host, connected as a smb share using a VirtualBox feature).
Copying the project over to a local drive fixed it for me. Not sure if assigning a drive letter would do the trick.
Also not sure why it does not work via network share, if it is a VS limitation or perhaps some plugin (I use resharper, of course).
For me this appears to have something to do with the project having the MVC 4 project type guid (E3E379DF-F4C6-4180-9B81-6769533ABE47). Removing this guid from the .csproj resolved the hanging for me. (An additional wiping of the .vs folder was required after removing the guid.)
I just removed "packages" folder from root of solution and it helped for me (Visual Studio Express 2015)
Sorry for having to create a new post instead of commenting on the selected answer .. I do not have enough rep to comment at this time.
My issue was was temporarily resolved by the "...delete the .suo file ..." solution, and as other folks pointed out, I had to delete the file every single time.
Since it (apparently) is impossible to stop the creation of the file I started to dig a little more into what the file did. In addition to saving user settings, I believe it is also saving session settings, like which files you have open when VS is closed. I suspected that my project is attempting to open a file that no longer exists and that is what is causing the hang. What fixed things on my end was to delete the .suo, open VS, open a file within my solution, build and close the solution. After doing this I have had no hangs.
tl:dr
In my case, a user setting file(.suo) was attempting to open a file in my solution that no longer existed. I resolved the issue by performing the following steps.
Delete the .suo file (for me this was in /[projectfolder]/.vs/[projectname]/v14
Open Visual Studio
Open your project
Open a file (I simply opened a random .cs file)
Build and save your solution (Simply saving may do the trick, I built by habit)
Close Visual Studio
Hope this helps someone ... we spent way too many hours on this issue :)
Lots of suggestions here and elsewhere but the only thing that permanently worked for me had to do with the start-up project I'd set. This is what I did:
Delete the .suo file as suggested elsewhere.
Start VS and open the solution. All should be well at this point.
Leave the start-up project as-is, even if it's not what you want.
Save the solution. (Possibly do as someone else suggests and open a file, clean, build/re-build, etc, but I didn't have to do any of that.)
Close the solution and exit VS.
Re-start VS and open the solution.
Change the start-up project to whatever it should be
Save the solution. (Possibly again do the open file, clean, build/re-build, etc.)
Close the solution and exit VS.
Restart VS and re-open the solution and all should be well.
This might or might not work for you but I'd tried everything I could find - registry changes, debugging VS from a second VS session, you name it - but nothing else worked for more than a single start/open.
Try to uninstall extensions with "Control Panel" or disable any add-in in [Tools]=>[Add-in Manager] then try to reopen the solution.
My problem was fixed by uninstall "Visual Localizer".
In my case the Fusion log has been enabled. Log files has been growing for months as I forgot to turn it off after investigation. This way the antivirus software started to check these big log files several times during opening the solution, and "Preparing solution..." message is visible for long-long time. When I noticed this, I turned off the fusion log, and problem solved. Solution loads in 10 seconds instead of 20 minutes.
I've had this issue multiple times, in pretty much all versions of VS. The one solution that seems to work most of the times is to delete the .vs folder located in the solution folder. Sometimes it's enough to delete the .sou file located in .vs///
The folder is hidden by the way, so you will have to enable "Show hidden files and folders"
For me the solution was to disable source control (Set plugin to None in Tools->Source Countrol). I think it was trying to sync some huge Git repo for some reason (have a couple of massive repos, but not in the tree I was trying to open).
I have fixed the issue by uninstalling these two plugins:
Productivity Power Tool
Web Essentials
I restored a previous version of the .vbproj file and it solved it.
I don't know what was in the newer version but the problem was something inside the .bvproj file itself.

Visual Studio 2013 Preview Not Responding frequently

I've installed the Visual Studio 2013 Preview to try out and I'm having some very bad performance issues. Every time I open a file and immediately try to close it, edit a file, save a file, etc. the IDE will stop responding for about 15 seconds.
I've gone through every performance tweak I could find through stackoverflow, blogs, web search, etc but none have worked (for example, clean up temp folders, disable add-ins and extensions, delete .suo file, etc.).
Using /safemode, the performance problems go away but I can't find what could be different since I have no add-ins, nuget packages, or extensions installed.
Using SysInternals Process Explorer, I can only see the process for devenv.exe peg the core it's using at 100% when it stops responding. I am not seeing any network or hard drive activity during this time and no other processes become active.
I've reinstalled with no luck, and I've installed it on another development machine where it seems to work just fine.
Anyone have any ideas?
Thanks!
UPDATE: In Process Explorer 'Other I/O Delta' shows ~200,000/sec when it locks up on the devenv.exe process. Still looking...
UPDATE 2: I guess I should add that this PC is a Dell Vostro 460, i7-2600 # 3.4Ghz, 8GB RAM, Windows 7, 1TB HDD with 550GB free, plenty of power for what I'm doing. Closed all other apps while debugging, including VIPRE A/V and Malwarebytes.
UPDATE 3: Maybe getting closer... using Process Monitor (love SysInternals stuff!) for some reason my entire C:\Projects\ folder is being parsed/searched by devenv.exe. I keep all my project folders under C:\Projects\ where there are about 20 projects each with their own sub-folder. Here's where it gets weird. In /safemode, devenv only parses the current project's folder, not the entire parent folder. Projects has 6,271 folders with 29,914 files. I tried creating a new c:\Projects2013\ folder, created a new test project, and devenv is trying to parse the full parent Projects2013 folder, yet in /safemode only parses Projects2013\Sample.
Obviously though the new project in Projects2013 runs full speed because it's parsing far fewer files. The other computer runs fine because I left the default Projects path and there were no other projects in that folder. Now what in the world could be doing this and why the different folder path between regular and safe mode? Time to dig through Tools, Options... ugh!
Here's a screen grab from ProcMon:
Final Update - Resolved! It was git causing the problem. I had a local repository set at c:\Projects\ which contained all my various project sub-folders. The dump file I created for them allowed them to narrow it down to git. Removing the local repository fixed my performance issue where VS 2013 is at least usable now. The programming team still needs to resolve the continuous re-parse of the folder though. Anyone with a very large repository will end up with this issue.
RESOLVED! It was git causing the problem. I had a local repository set at c:\Projects\ which contained all my various project sub-folders. The debug dump file I created for the VS programmers allowed them to narrow it down to git. Removing the local repository fixed my performance issue where VS 2013 is at least usable now. The VS programming team still needs to resolve the continuous re-parse of the folder though. Anyone with a very large repository will end up with this issue.

Resources