The device is not ready error when opening Visual Studio 2012 - visual-studio-2012

I get the error "The device is not ready" when I open visual studio, and also when I try to interact with TFS (check in, get latest, etc.)
I have tried the following to correct the issue with no luck in resolving it:
Reboot
Repair Visual Studio
Uninstall/Reinstall Visual Studio
What device is not ready? How can I make it ready or otherwise correct this error? I'd prefer to not reinstall my OS, but I will if I need to.

This is (mostly) caused when the location your workspace is pointed to is no longer available.
All you need to do is reset the workspace
(
open sourcecontrol,
in the toolbar click on the dropdownlist workspaces,
edit the workspace of the computer the drive changed
set the local folder to the correct location
)

I think this sort of thing can be caused by a no-longer-accessible drive. Here's something to try: Clear out your Most Recently Used project and file lists:
Run regedit.
Navigate to HKCU\Software\Microsoft\VisualStudio\11.0\ProjectMRUList.
Delete all the "File" items (File1, File2, File3, etc.).
Navigate to HKCU\Software\Microsoft\VisualStudio\11.0\FileMRUList.
Delete all the "File" items (File1, File2, File3, etc.).
If that doesn't work, have a look through the other items in 11.0 and under it, looking for no-longer-valid directories. Here are some other nodes to look under:
11.0
11.0\External Tools
Find (might have a directory specified for find-in-files)
JavaScriptLanguageService
Keyboard
NewProjectDialog and subnodes
...and there are probably several others, but at this point I got bored with looking. Anyway, look through the various nodes for a network location or removable drive that doesn't exist anymore, and get rid of that path or point that path elsewhere, and see if the problem goes away.

I recently had a HDD fail, which I managed to repair. In doing so, the drive letter changed. I changed the letter of the drive back to its original letter designation, and this issue no longer occurs.

I just had the same problem. I had clicked the button that was asking me to upgrade to a local workspace. After I did that I was getting the 'device not ready error' anytime I tried to do anything with TFS. The response marked as an answer did not help me. I had to completely remove the workspace (via the menu described in Olivier's answer) and then re-add a new workspace.

Related

Android Studio does not remember configured modules

Everytime I restart Android Studio it forgets the configured modules despite them shown as configured in the ProjectStructure>Dependencies menu and I manually have to remove them from ProjectStructure>Dependencies and then add them again.
I also tried invalidating the chache, cleaning and rebuilding but the only thing that works is to manually remove the dependencies and to add them again.
What is causing this behavior?
I never faced this problem, but i would check this points:
Do you have other software like git accessing the project folder and maybe overriding some important project files?
Does your user have the rights to write data into the project folder and the configuration files?
Does the Event Log shows something interesting?
Does the log shows something? Help > Show Log in Files > idea.log
i recommend using Ctrl+F to find any occurrence of Error
If you are on linux you can use find -cmin -30 to get a list of all files that were changed in the last 30 minutes. That might be useful to spot the problem.
It might help if you give us your operating system (and version) and android-studio version.

Sync Android Studio projects across multiple workstations

I want to be able to work across multiple workstations synchronously jumping from one to the other without having to worry about committing.
I have windows personal and work desktop and a Mac OSX laptop. At the moment, I point my project to a cloud directory and have the local install of Android Studio pointing to a gradle offline cache in another cloud directory. This keeps failing as it tells me that the path to gradle is invalid. Which I understand because gradle is referenced in different locations on different machine (considering the differing file management system in MACOSX and Windows7).
Edit: When I try to open the project, it brings up the "Import Project from Gradle" screen. To which it has the option for me to select "Use local gradle distribution" and select the Gradle home directory. I pointed it to the cache directory, and it tells me:
Cannot Save Settings
Gradle location is incorrect.
Location:C:/Users/Username/.gradle
All my research (include these answers here, and here) suggest that VCS is the way to go. However, I don't see this as a solution to my problem. I'm not looking to version control, I'm looking to transition seamlessly across workstations. Of course I will still use Version Control System for the purpose of saving a working version of my code, or sharing it with other developers, but there has to be a better way when I simply just want to keep all workstations synced.
I come from web development, and I synchronise local environment on AMPPS across multiple computers without any issue. This meant I can transition from my personal desktop, laptop, and work desktop instantly. It frustrates me if I have to remember to commit every time I move around. If I have to do this 20 times a day, and it takes about a minute to do this, that's 20 minutes that could have been spent writing a couple of functions. And what if I forget to commit, then I get to work, or home, that would be a day wasted because I won't actually have the current up to date code...
So the question remains, is there a way to instantly synchronise Android Studio projects? How do I keep all my code base (ie gradle) in sync?
Ok thanks to the comments above which pointed me in the right direction.
Android Studio create some local files that are specific to the machine that you are on. Following on this principle, to sync the "source" files (files that are specific to your application only), you must ignore all these local files. This is similar to what you would store on github. I followed the answer for this question to apply the ignore rules.
Having ignored all the "local files", when I create a new project, the source files are synchronised across all my workstations. In order to establish a local version, I need to "import" the project first. Once it has been imported, "local files" will be created for that particular machine. From then on, I can "open" the project locally.
To summarise:
Set your sync to ignore files as per .gitignore or refer to this question.
Create a project on one of your workstation and save it in the cloud.
When you are ready to work on the project for the first time on another workstation, "import" the project.
Once the project has been imported, all local files should have been created.
From then on, use the "open" option to continue working on the project.
I hope this helps somebody else, saving hours on googling.

Removing deleted files from TFS 2012 Source Control

I am having issues trying to mark files as 'Delete' that have been deleted from my local machine by an application. The issue is that these files no longer exist so TFS will not process them as 'Deleted'.
I have downloaded the TFS 2012 Power Tools and tried to run 'tfpt.exe online /deletes /recrusive ' but this simply gives me a list of folders that these missing files sit in, not a list of each and every file themselves. This means that when I click 'Pend changes' I get the following error message for each command -
"One or more children have pending changes".
My question is, is anyone aware of a method I can use to carry out this process?
It sounds like tfpt online is detecting that the folders have been deleted. It is trying to pend a delete on those folders, but it sounds like you have already pended different changes on the files within those folders.
tfpt online will not pend a deletion of the folders if you have other changes pended for its children.
If you want to delete the folders, undo the pending changes on their children, make sure that the contents on-disk match what you want, then re-run tfpt online.
If there's not too many files you could run the destroy command in Visual Studio Command Prompt.
Destroys, or permanently deletes, version-controlled items from Team
Foundation version control.
Command
tf destroy $/MyProject/Files/123.cs /collection:http://servername:8080/tfs/myproject

VS2012 detects change made outside VS and mark files checked out

On my VS2012 I noticed that if i edit a file that is not checked out in a notepad and save it, in TFs it will be marked as checked out and edited. So far we haven't found too much of a problem of it, but potentially people can get careless and make/save changes unintended.
Is there anyway to turn off that feature?
What you're seeing is now default behavior for Local Workspaces. One way to 'undo' this is to set your workspace to a server workspace once more. But I suggest you first investigate the benefits of local workspaces before deciding to turn it off. People still have to check in files, so there is a gate between changing the file and actually committing them to source control.

Get last version not working Visual Studio 2012 in TFS

I have Visual Studio 2012 and when I'm trying to get last version it doesn't work and it says that it's says that "All files are up to date". It is because I deleted file locally after I got it from TFS and I guess in Visual Studios memory it's written that there were no changes from that time I got it and now it doesn't let me download it although I don't have it.
How to "tell" VS that my local folder is changed?
P.S. I guess it can be also done with "Get specific version" but that option doesn't appear to me when i right-click on file I want to get from server.
EDIT:
I found that my workspace changed automatically (or rather with me not being concentrated while making new project), so VS was actually checking other directory all the time. For all those who might have the same problem - check your local path and if you see that it's not good, change it.
Here is how you can change it:
http://social.msdn.microsoft.com/Forums/en-US/tfsversioncontrol/thread/d0c6982f-4f5e-4b1c-830b-3af9fb127922/
You are right, TFS saves what version he gaves you and changing/deleting it without to notify TFS, you won't get anything. The "Get Specific Version ..." is what you need. Therefore rightclick on the item you want, in context menu choose "Advanced --> Get Specific Version". Check the second option to "Overwrite all files even if the local version matches the specified version".
Not saying this is a solution, but I had similar issues after remapping one of my projects. Ultimately what I did was delete my local Solution File (.sln) and re-opened the project via the Project File (.vbproj). After that I was able to see all of my latest file versions that appeared to not be down loading. Once you click save on anything it will re-prompt you to save a new solution file.
i don't know if this is specifically what the OP was trying to accomplish, but here's my story: my machine crashed, had to get it reimaged; once VS2015 was installed, i went to source control explorer, right clicked the branch i needed >> Advanced >> Get Specific Version, checked the "Overwrite..." boxes, clicked "Get" and got the "All files up to date..." message. buster. obviously the code was NOT up to date.
fast forward: i fixed this issue by deleting my workspace's pertinent mapping to code base i needed, saved it, and re-added it.
hope this saves some headaches.
You'll want to Get Specific Version and to check the box to enable overwriting of existing files. That will ensure you're actually up to date.
You can also switch from a server worspace to the new local workspace which should also help solve issues like this.

Resources