Yesterday Nuget server was down for couple hours. That wasn’t nice. I got stuck for a bit, because I blew up my environment and needed to re-download all the packages again. And some of them were not in the local cache. And just the same night Mr. Mark Seemann blogged that auto-restore in Nuget is considered harmful. And I could not disagree with Mark. Amount of time I’ve spent on trouble-shooting missing packages or package restore in the last year mounts to probably a week. Most of that time was spent for package restore on build servers. And just for these little shits I had to dig very deep into TFS build template, modify it, so it can restore packages before attempting to build it. It was not a nice experience.
Anyway, long story short. Today I decided to give that advice a go and check in packages for one medium sized project hosted on TFS. I went to Source Control Explorer, added existing folder of packages
, it added a big number of files and then I checked-in.
Build server crunched for a moment and failed the build: references are not found. Strange. Connected to the build server and discovered that TFS by default ignored *.DLL files but included all other crap that comes with nuget packages (xml files, readme.md, source code, etc.). That was strange. After a bit of digging I found that TFS has a list of file-types that it looks for.
In Visual Studio menu go to Team -> Team Project Collection Settings -> Source Control. And you’ll be presented with list of file types:
Make sure you have an entry for “Executable files”:
That should seal the deal. I actually had this record, so this was not the problem I experienced.
Moving forward. In Source Control Explorer right click and go “Add Items to Folder” and pick you packages
folder. And don’t click Finish as you usually do (or I usually do). Instead click Next
Then you should see something like this:
Please note, this is a list of files that is Excluded from the check in. Select them all and click on Include items
on bottom right.
Now you can click Finish and check-in your pending changes.
And next time pay more attention!