I would like to start by saying that git, git-tfs and Nuget are all technologies that have made developing software much easier. However I am writing this to explain how to avoid one pitfall. First let’s set the stage:
- I was using the sample .gitignore file that can be found here
- I was using git-tfs to make integrating with TFS easier.
- I wanted to use a better mocking framework than RhinoMocks and had decided to try out NSubstitute.
Of course, like any sane developer I installed NSubstitute using it’s Nuget gallery. I wrote my unit tests and checked in my code. By the way, I highly recommend NSubstitute over RhinoMocks. I had automated builds in place, and I watched it go as it builds my latest check-in.
However it choked and didn’t even compile. I checked the output to find a lone error stating that the NSubstitute.dll could not be found, but it worked on my machine. The problem was that I didn’t check it into git which kept git-tfs ignorant of it and hence TFS. The reason is that the .gitignore file I used included the following:
# Compiled source # ################### *.com *.class *.dll *.exe *.o *.so
The intent of this section makes perfect sense, and it is certainly a best practice not to check-in binaries. However in this case, we actually wanted to check-in dependent binaries. The problem was that the above .gitignore file does not discriminate between binaries in:
I ended up modifying my .gitignore file to simply have the following:
I hope this saves others some time and stress.