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:

  1. I was using the sample .gitignore file that can be found here
  2. I was using git-tfs to make integrating with TFS easier.
  3. 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:

solutionFolder/packages/

vs.

solutionFolder/ProjectFolder/bin/

I ended up modifying my .gitignore file to simply have the following:

bin/

I hope this saves others some time and stress.

Advertisements

One thought on “Git / Git-tfs / Nuget Gotcha

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s