Visual Studio 2010 Automatic Check Out Not Working on File Edit or Save
-
martedì 6 luglio 2010 20:00I have a solution of 4 projects under source control in a TFS server. I am using Visual Studio 2010 and have a workspace set up locally on my machine. Under Tools->Options->Source Control->Environment I have the Settings set to Team Foundation so all the check boxes are unchecked and under Checked-In Items I have Saving: set to "Check Out Automatically" and Editing: set to "Check Out Automatically". Allow checked-in items to be edited is also unchecked (though I tried this with it checked as well and it did not fix my problem).
When I edit a file in Visual Studio 2010, it does not get checked out. So when I make some changes to any file and try to save, I get the message:
The file X.cs cannot be saved because it is write-protected.
You can either save the file in a different location or Microsoft Visual Studio can attempt to remove the write-protection and overwrite the file in its current location.
I then have to select Overwrite. When I go to my source control, it doesn't recognize any change. It says I have the latest code and there is no pending change. I have to manually check-out the file before it realizes there is a change and then I can check it in.
My colleague has another workspace in the same project and his works fine. If he edits a file, it immediately checks out the file and shows a pending change in his source control. We have the exact same version of VS2010 (10.0.30319.1). I went through his settings and they are identical to mine. I even deleted my workspace and tried to create another one and I still have this problem. Going through every file I want to change beforehand and checking it out manually is just ridiculous. How can I make the automatic check out work again?
Tutte le risposte
-
martedì 6 luglio 2010 20:12
Hello,
Please go to Tool/options/ Enviroments / Document
Ensure that "Allow editing of read only ...." is unmarked.
This should resolve this issue!
Regards
[]'s Alexandre Campos -
martedì 6 luglio 2010 20:19
All this does is not give me the dialog:
The file X.cs, which you attempted to edit, is read-only on disk. Would you like to make the file writeable or edit it anyway?
With the options "Edit In-Memory", "Make Writable", "Cancel" and "Help"
Selecting Make Writable will let me edit the file, but it still does not show up properly in my source control as a changed file even if I make changed. Nothing is listed in Pending Changes. Source control still tells me I have the latest file. It is still not checking out the file automatically. This doesn't fix the problem.
-
martedì 6 luglio 2010 20:48
Interesting...
Some questions:
1- The solution is bounded to source control?
2- How do you usually make a checkout checkin? via solution explorer or via source control?
3 - In solution explorer you can see the icons of source control?
4- Access the file/source control/change source control. Everithing is connected and valid?
[]'s Alexandre Campos -
mercoledì 14 luglio 2010 05:49Moderatore
Hi Sagaraw,
How is the issue now?
Best regards,
Ruiz
MSDN Subscriber Support in Forum
If you have any feedback on our support, please contact msdnmg @ microsoft.com -
venerdì 16 luglio 2010 15:29
Hey Sagaraw,
I was experiencing this exact same issue. By any chance did you notice your solution "go offline" at any point? During my searching trying to resolve this issue, I came across your post here, and another one, here: http://social.msdn.microsoft.com/Forums/en/tfsgeneral/thread/075b878f-9d05-4819-a47b-780402a6bd02 that reminded me I had seen my solution "go offline" at one point.
I went to File -> Source Control -> Go online, and now files are again being auto-checked out for editing again.
Hopefully that is your issue, too.
- Proposto come risposta Stephane D mercoledì 8 settembre 2010 14:28
-
venerdì 23 luglio 2010 22:53
I've seen this suggestion on multiple threads and discussions. And since my Internet connection drops occasionally, I do believe VSTS has gone offline now and then.
Unfortunately, there's no Go online option in my Source Control menu, nor any Go Online button in my Source Control Explorer (as I saw in one discussion). Is there something I have to do to enable that option?
I should add: automatic checkout was working just fine for my first month of VSTS use. Then our admins moved our server, and it stopped working (but that may have been coincidence, or may be because my connection went offline while they were moving). They had me try refreshing my workspace. That didn't help. Then they had me try refreshing my DNS with this commmand line:
ipconfig /flushdns
That seemed to fix the problem for a couple of days. Now it's back.
UPDATE: I found a Go Online command in the context menu for the solution. Still nothing on the File -> Source Control menu. But the one on the Context Menu fixed my problem. Thanks!
Martin L. Shoemaker- Modificato Martin L. Shoemaker venerdì 23 luglio 2010 22:57 More info
- Modificato Martin L. Shoemaker venerdì 23 luglio 2010 23:21 Found the fix!
-
venerdì 13 agosto 2010 19:56
Just installed Team Studio 2010 and having the same 'not checking out automatically' problem. confirmed the settings mentioned above. Do not have an off-line problem. But still the auto check out does not seem to function as expected.
As a work around it would be nice if the dialog: "Edit In-Memory", "Make Writable", "Cancel" and "Help" added a "Check Out Now" option.
Thanks
-
venerdì 3 settembre 2010 13:36Thanks, this solution worked for me.
-
domenica 28 novembre 2010 10:58
Hello all,
I found out the clean solution to it.
Action:
Just goto File->SouceControl->Change Source control. Select all projects and click bind, to bind them to TFS (source control).
Result:
The icons of lock and face(if checked-out) will start appearing next to files in solution explorer. This means now the files are bound to source control and they will honour your Source-Control options as given in Project->Options and Settings->source control.
As for this particular problem, this will allow to checkout files automatically on edit.
-Munish Goyal
- Proposto come risposta Aditya Barman giovedì 22 dicembre 2011 00:56
-
martedì 30 novembre 2010 15:42I just had the same issue. In my case, I found that when I had gotten the latest version of the source code from Source Control, the source files were writable (i.e., not read-only); so when I attempted to edit a file, the automatic checkout did not occur. When I re-obtained the source code from Source Control (this time ensuring that the "make writable" option was unchecked), the automatic checkout resumed once the files were read-only.
Josh -
venerdì 17 dicembre 2010 06:45
I had a similar problem and thanks to your comment finaly solved, thanks for advance.
Point was that I was working on some kind of off-line mode, come to switch to online all work fine.
-
venerdì 17 dicembre 2010 16:26
I have a similar issue with "checkout automatically" for files that are added to a solution/project. I binded the solution and the files associated with the solution/project are still not automatically checkedout when I tried to change and save the file. It pops the dialog "Edit of Ready-Only File" with the error message:
The file actl.rh, which you attempted to edit, is read-only on disk. Would you like to make the file writeable or edit it anyway?
..... And the options are "Edit In-Memory", "Make Writeable", "Cancel", or "Help".
As soon as I exclude a file from the project, "checkout automatically" works again when I change & save the file.
My settings for "check out automatically" are:
Tools -> Option -> Source Control -> Environment -> Checked-in items
- saving: Check out automatically
- Editing: Check out automatically
Could it be a problem with solution/project settings?
ps. I am using VS2010 on VISTA.
Thanks,
Luong
- Proposto come risposta Mayur.patel.ama martedì 19 giugno 2012 16:06
-
venerdì 17 dicembre 2010 18:14
I found the problem. I binded the solution but I did not bind the projects...
"checkout automatically" works now after I bind the projects.
Thanks,
Luong
-
venerdì 11 febbraio 2011 00:25
I just had the same issue. In my case, I found that when I had gotten the latest version of the source code from Source Control, the source files were writable (i.e., not read-only); so when I attempted to edit a file, the automatic checkout did not occur. When I re-obtained the source code from Source Control (this time ensuring that the "make writable" option was unchecked), the automatic checkout resumed once the files were read-only.
JoshIn my case this comment really helped. I am using VS2010 with Visual Source Safe. I am sure that I haven’t got latest with the “Make Writeable” flag checked. But for some reason a lot of my files are checked IN but NOT read-only. So if I edit them they don’t check out correctly.
I am going to set the read-only flag for all my checked in files and hopefully no more problems. IMHO, I think relying on the read-only flag to trigger a check out is a bit weak. This is so important I think another method should be used. But I guess I am not a source control guru - just a long time user...
-
lunedì 6 giugno 2011 14:00
Hello all,
I found out the clean solution to it.
Action:
Just goto File->SouceControl->Change Source control. Select all projects and click bind, to bind them to TFS (source control).
Result:
The icons of lock and face(if checked-out) will start appearing next to files in solution explorer. This means now the files are bound to source control and they will honour your Source-Control options as given in Project->Options and Settings->source control.
As for this particular problem, this will allow to checkout files automatically on edit.
-Munish Goyal
This worked for me.I had set up TFS and checked in the solution but because it was not bound I was getting the error message above. Once I bound it then the silent check out worked as expected.
-
mercoledì 8 giugno 2011 14:14
Worked!!
This was driving me nuts. Auto-checkout wasn't working, so I'd been manually getting files and checking them out and running TF gets. Not exactly behavior that you would expect to work when you are "offline". Nonetheless, we DID have a network outage a week ago, so this explains it.
I wish it was easier to tell what state TFS was in, but I guess now that I know where to look...
-
lunedì 8 agosto 2011 14:11
Thanks Jordan, that fixed my problem.
Thanks
Sai
-
venerdì 12 agosto 2011 20:41This worked for me. Thanks
-
giovedì 5 gennaio 2012 16:44
The solution that worked for me was: Tools -> Options -> Source Control -> Environment
Under Checked-in items ensure the following:
- Saving - Check out automatically
- Editing - Check out automatically
- Allow checked-in items to be editied is checked.
Hope this helps someone else!
-
mercoledì 25 gennaio 2012 18:53
Hello,
I tried to do this for my solution, and any of the projects under my solution (which are all in TFS source control), but I get the following prompt when trying to Change Source Control:
Most of my files are read-only right now b/c I don't have them checked out of TFS. Do I need to check EVERYTHING in first using the Source Control Explorer before trying to change Source Control?
I'm not too sure what the best option for this prompt is. I don't want to loose any local work (which is why I asked if it's a good idea to check everything in first before trying to change source control), but I do want to be able to check files in and out directly from the VS2010 ide and stop having to use Source Control Explorer...
Thanks,
Mike
-
giovedì 15 marzo 2012 14:18
Hey Sagaraw,
I was experiencing this exact same issue. By any chance did you notice your solution "go offline" at any point? During my searching trying to resolve this issue, I came across your post here, and another one, here: http://social.msdn.microsoft.com/Forums/en/tfsgeneral/thread/075b878f-9d05-4819-a47b-780402a6bd02 that reminded me I had seen my solution "go offline" at one point.
I went to File -> Source Control -> Go online, and now files are again being auto-checked out for editing again.
Hopefully that is your issue, too.
Thank you! Your solution fixed my issue.
-
mercoledì 21 marzo 2012 08:27
Hi,
1. Start TFS in IIS
2. In source control Right Click on file select Go Online option.
Then you can able to checkin, checkout files.
Thanks,
Rajesh.
-
mercoledì 11 aprile 2012 15:50
I've had success with changing my settings in VS2010:
Tools -> Options -> Source Control -> Integration Options -> When Check Out is Required, on Edit -> Automatically Check Out
This allows me to bypass that pesky Check Out dialog whenever I want to edit a file.
Good luck!
-
martedì 19 giugno 2012 16:06
This is perfect solution..:) Thanks,
-
mercoledì 8 agosto 2012 14:18This solved it for me. Thanks!!
-
lunedì 17 settembre 2012 19:39
I found out the clean solution to it.
Action:
Just goto File->SouceControl->Change Source control. Select all projects and click bind, to bind them to TFS (source control).
---
thanks! That worked. That was a big help.
-
giovedì 28 marzo 2013 15:19
Same issue, and this fixed it.
Binding was missing, and VS thinks it is online as well.
But whats strange is if u go offline, and go online manually on the solution, the changes show up. That is what I don't get.
Anyway glad that binding helped resolve the issue. Thanks Munish!

