We are using C# projects with TFS as source control and for the CI builds.
I keep finding that other developers are referencing assemblies from /Bin
directories incorrectly when they should be using our /Libs
folder (where we keep 3rd party assemblies)
What can I do as part of the solution build or CI build (we do also use powershell) to check and fail the build if anyone does this?
Add a custom activity to your build process template. The activity's pseudo code should look like:
HintPath
elements containing\Bin
.To complete the solution also consider enforcing a custom check-in policy for the VS clients.
Since you are using PowerShell you might as well use it for this problem; the principle is straightforward: parse all csproj files and check if the HintPath doe not contain your Bin directory. In PowerShell that is something like (I've only just begun learning PS so there might be shorter ways):