Home > View Post

Why does Visual Studio keep checking some project files out?

I was on site with a customer recently when I was asked why Visual Studio would automatically check out project files when getting latest (or specific) from TFS.

I had a look and, sure enough, there were 3 project files checked out with pending changes. The first thing they tried was to undo the pending changes (meaning the project files were no longer checked out) but then the minute they got latest, or even tried to build the project, VS would check out those project files.

I checked with some of the other developers and, unbeknownst to them, they had the same projects checked out too. Weird.

So, we did a Compare to see what, exactly, VS was doing to these files and it turned out that Visual Studio was fixing a bad HintPath in the project. Changing it from an absolute path (that was invalid on this machine) to a relative one. Wow!

Now this seems like a missed opportunity to me. I am pretty impressed that Visual Studio can do this (and still not sure quite how it does it). If only VS had prompted the user with something like this:

Your Project has a dodgy HintPath in it. But don't worry, I can fix it! Would you like me to check it out and sort this for you?

Then we'd have customers as impressed with this as I am, and not lamenting the stability of VS & TFS. Still, problem solved and nice to know VS is looking out for me.

Tags: .NET

Josh Post By Josh Twist
1:15 AM
01 Aug 2008

» Next Post: WCF: The type provided as the Service attribute could not be found
« Previous Post: Updated data-binding friendly script for Data Services

Comments are closed for this post.

Posted by Inferis @ 01 Aug 2008 5:41 AM
Or, thry might start complaining about that pesky HintPath dialog always appearing. :)

So a: "Don't show this message again" in combination with detecting if the file needs to be checked out to modify the file (I suspect there are people not using source control), would be perfect.

Posted by red @ 18 Sep 2009 8:09 AM
for some reason, occasionaly a get latest will get me some other developers 'checked out' list so that VS thinks I have them checked out.
First step is always to 'undo checked out'

© 2005 - 2022 Josh Twist - All Rights Reserved.