TFS - files not showing under source control in Visual Studio

While using the Visual Studio 2010, 2012 or 2015 Solution Explorer pane, I've noticed after getting latest from source control (in my case TFS) new files retrieved are missing the lock indicator.


Missing source control lock on new file retrieved from TFS


I'm not sure it makes any difference to the project, the build or your pending changeset, but it always annoyed and worried me. To have the lock icon show again, I'd exclude the file from the project, re-include it, and undo changes, resulting in my .proj file getting checked out.

That was until I came across the Refresh Source Control Status option. It's a little tricky to remember where that is, so here's a screenshot from VS2015. You may have to focus on the Source Control pane before using this for it to work for you.


Refresh Source Control Status