Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No padlock icon for some projects in a source controlled solution

I have a large solution in Visual Studio that is under TFS Source Control but I've noticed one of the projects (c#) doesn't have a padlock icon next to it in Solution Explorer.

The project and it's files are all under source control, I can look at the history and do other tasks. None of the files have the padlock, but strangely the properties folder does.

What is the cause, what does it break and how do I fix it.

like image 434
Stephen Turner Avatar asked Jun 04 '14 11:06

Stephen Turner


1 Answers

All that is wrong is that the Project file does not have the correct binding to TFS. There is a section missing in the .csproj file that should look something like this:

<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>

Where SAK (probably) stands for Solution Already Knows.

As far as I know it only affects the display of the Source Control status in the Solution Explorer as noted you can already perform other source control tasks on the project. It's not much but worth fixing as it's a good visual check that everything is being controlled.

To fix it highlight the project in the Solution Explorer, then go to File > Source Control > Advanced... > Change Source Control... Select the project in question in that list (it'll probably look fine and valid), click Unbind, ok the warning then click Bind (the same toolbar button relabelled) Ok that window, and checkout all the files it suggests. This will make the necessary changes and the padlocks should appear. Review and check the changes to keep them.

like image 89
Stephen Turner Avatar answered Sep 23 '22 18:09

Stephen Turner