Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I find files not in TFS source control with Visual Studio?

We have occasional problems with files not going into TFS 2010 source control after being added to the project. So that the CSPROJ file has reference to them so when another developer gets the project you get a missing file issue as the files never get checked in.

If this happens for cs files etc the build fails. However for resources - images etc. this doesn't get caught by the build.

Is there any plugin or tool that will highlight which files in a project structure are not included in source control. We are reduced to looking for the little padlock icon.

Also I guess anyway of making the build fail if files are missing from the CSPROJ file - we use Team City.

like image 597
GraemeMiller Avatar asked Oct 20 '22 07:10

GraemeMiller


2 Answers

You can create a MSBuild target and add an additional step in Teamcity to call this target. You can check How to fail an MSBuild when content files are missing to create your MSBuild target.

like image 107
Mohammad Nadeem Avatar answered Oct 23 '22 02:10

Mohammad Nadeem


You are likely hitting this issue as you are following an unsupported workflow when adding files. For 2010 you should always add files through the project in Visual Studio. There is a little button at the top of the solution explorer that allows you to view hidden files. From there you will see files in the folders but not added in the project in gray. If you right-click and 'include in project' it will also be added to source control.

You should for sure put protection in the build if you can, however don't use a broken build as a band aid. They should be an exception rather than the rule. A broken build is always a moment to inspect your processes and adapt so that you don't get the same issue again.

Continuous broken build for the same reason shows apathy in your development teams and is indelicate of a larger people issue.

like image 36
MrHinsh - Martin Hinshelwood Avatar answered Oct 23 '22 03:10

MrHinsh - Martin Hinshelwood