AaronLST

Automatic check-out on-edit no longer occurs in VS 2005. This has happened on several of our workstations.

Under Tools->Options->Source Control:

Environment:
All boxes are cleared and On Edit is "Check out automatically"
I have compare files by checksum set under Plug-in Settings -> Advanced.



Re: Visual Studio Source Control and SourceSafe Automatic Check-out stopped working

AaronLST

If I make the file read only on the disk(apparently this isn't being done by default for some reason), then it gets checked out whenever I edit. This seems like a bug. It should checkout whenever I edit, not whenever i edit AND the file is read only. Anyhow, I'll look around to see if there is any reason it isn't marked as read only when I pul down the latest version.




Re: Visual Studio Source Control and SourceSafe Automatic Check-out stopped working

AaronLST

Also "Allow checked-in items to be edited" is cleared, so I'm not sure what the purpose of that is, but I can edit to my heart's content despite the fact that none of the fiels are checked out.



Re: Visual Studio Source Control and SourceSafe Automatic Check-out stopped working

Richard Berg MSFT

What source control provider are you using We've fixed this for Orcas in the TFS provider. I'll make sure VSS gets this fix too.




Re: Visual Studio Source Control and SourceSafe Automatic Check-out stopped working

AaronLST

We have VSS 2005 with Visual Studio 2005 for the client. VSS 2005 installed on the server.

Thanks.




Re: Visual Studio Source Control and SourceSafe Automatic Check-out stopped working

AaronLST

Richard Berg MSFT wrote:
What source control provider are you using We've fixed this for Orcas in the TFS provider. I'll make sure VSS gets this fix too.


Is there a workaround What causes this
We have only experienced this on three machines. One of them had just been reformatted, and had the problem right from the beginning. The other two didn't have the problem at first, but it has cropped up.




Re: Visual Studio Source Control and SourceSafe Automatic Check-out stopped working

Richard Berg MSFT

Are you still talking about the automatic checkout problem I confirmed it's a bug and am pushing for it to be fixed in Orcas. The workaround is to find out what's making the files writable on disk and stop it Smile




Re: Visual Studio Source Control and SourceSafe Automatic Check-out stopped working

AaronLST

Aw heck, those last two posts are in the wrong thread. I deleted the unrelated posts.

I'll mess around with it some more and see what I come up with.






Re: Visual Studio Source Control and SourceSafe Automatic Check-out stopped working

AaronLST

Editing the file in VS makes it writable.

If I explicitly make the entire solution folder and all subfolder/files readonly, then open the solution and edit a file, then the file gets checkedout and becomes writable. The problem is it doesn't make it readonly again when I tell it to checkin from VS thus the second time I edit it, it doesn't get checked out.

I misunderstood and thought at first you had said it was already fixed in Orcas, so I was hoping you might have some idea as to the specific conditions that causes the bug to appear.




Re: Visual Studio Source Control and SourceSafe Automatic Check-out stopped working

AaronLST

Is there a config file somewhere for the "Allow checked-in items to be edited" setting that I can look at It is cleared in the GUI, but I fear that maybe somehow there is a configuration file that has it set and this this may be why it is not setting the read only attribute when items are checked in.




Re: Visual Studio Source Control and SourceSafe Automatic Check-out stopped working

Richard Berg MSFT

The bug is that VS should always checkout the file, even if it's writable on disk. It's on track to be fixed in Orcas (hopefully in Beta 2).

It sounds like you came across another potential bug: Visual Studio causing the file to be writable-but-not-checked-out in the first place. So long as you were editing the file while the solution was active and bound to source control (not in offline mode), that shouldn't happen.

I don't know much about the "allow checked-in items to be edited" setting. I'll have someone else follow up.




Re: Visual Studio Source Control and SourceSafe Automatic Check-out stopped working

Boloh

Is there patch/hotfix for this in the meantime This is a really strange behavior, and I'm CONSISTENTLY seeing it when i migrate a .NET project from VSS to VSTS.

Surely you can not expect each user to set each of their file to 'read-only' before they start working on their projects





Re: Visual Studio Source Control and SourceSafe Automatic Check-out stopped working

Richard Berg MSFT

Files should definitely be read-only before you start working. VSS and TFS both rely on this. In TFS there are some safeguards to make sure we don't clobber writable files by accident, but they're just that -- safeguards -- not mainline behavior. We recommend you not touch the file attributes on disk and let the source control system handle it.

There is no patch for VS 2005. We don't generate patches automatically; someone has to call Customer Support and push for a hotfix.

BTW, I checked on the bugs I filed: it will be fixed in VS 2008 for TFS, but not for VSS. The VSS behavior has apparently been around long enough that they were afraid it might break other people's configurations.




Re: Visual Studio Source Control and SourceSafe Automatic Check-out stopped working

AaronLST

Richard Berg MSFT wrote:
Files should definitely be read-only before you start working. VSS and TFS both rely on this. In TFS there are some safeguards to make sure we don't clobber writable files by accident, but they're just that -- safeguards -- not mainline behavior. We recommend you not touch the file attributes on disk and let the source control system handle it.

There is no patch for VS 2005. We don't generate patches automatically; someone has to call Customer Support and push for a hotfix.

BTW, I checked on the bugs I filed: it will be fixed in VS 2008 for TFS, but not for VSS. The VSS behavior has apparently been around long enough that they were afraid it might break other people's configurations.


I'd just like to note that I wasn't initially messing with the file attributes when I first saw the problem. Setting the file to readonly was just something I discovered would cause the file to checkout when edited. But then when checked in again it doesn't set the file to readonly, and thus the next time it is edited it doesn't get checked out. So it wasn't even a viable workaround, just soemthing I observed that I thought might help determine the cause of the problem.






Re: Visual Studio Source Control and SourceSafe Automatic Check-out stopped working

AaronLST

I don't mean to resurrect old threads, but I have finally figured out the cause of my problem and thought I should post the solution. It was a VSS plugin setting that somehow had gotten cleared. My coworker had the exact same problem and I am not sure how it ended up like this. Anyhow, just to summerize the problem and the solution:

Problem:
When editing a source controlled file in VS 2005, the file does not automatically checkout. This can be caused by the file not being readonly. Setting the file to readonly, and then editing it, will cause it to be checked out, but this does not resolve the issue. Once the file is checked in again, it remains writeable, thus it will not check out automatically the next time it is edited. Essentially, the problem is that the file is not set to readonly when checked in.

Solution:
Under Tools->Options->Source Control->Plug-in Settings->Advanced...->Local Files
Check the "Use read-only flag for files that are not checked out".

This setting ensures that when a file is checked in, it is set to read only. Thus it will correctly check out on edit the next time it is edited.

Note that at the time you correct this setting, files currently checked in but are already writeable will continue to have the problem. You must go through and set all your files to readonly.

These advanced settings are apperently stored with the user's information in source safe, so changing this setting for a user on one machine, will affect them on other machines. This is why it seemed that the problem continued to exist even when I went to a different computer and a completely different VS project/solution.

Of course, you must also have Tools->Options->Source Control->Environment->On Edit: Check out automatically selected.