NuGet Causes Needless Headaches With RavenDB, RestSharp and Json.Net September 25, 2012Posted by ActiveEngine Sensei in .Net, ActiveEngine, Mythology, Open Source, Problem Solving.
Tags: Json, Nuget, RavenDB, RavenDB Json versions
Just because something is shiny and promises riches doesn’t mean you should put it in your pocketses. NuGet, while good for getting an assembly for quick and dirty research and development, is a tour to the valley of frustration when you need to focus and deploy a solution with many dependencies.
NuGet has a pretty dialog box so you think you can just “wire up” and go, but this is an illusion my precious. Sometimes it doesn’t update the Hint path. Sometimes it forces you to install packages in certain order, as with SignalR, RestSharp and RavenDB.
Think about it – NuGet pulls down files, creates directories and then references to all the paths that were just created. We can’t do that ourselves by pulling a directory, the adding the reference to old fashioned way, meaning the way that leaves you feeling more in control, not requiring you to spend hours hunting references in package.config files in different folders? The main premise is to eliminate this practice, right? What is going to happen when you introduce AppHarbor into the mix where you won’t be able to look and the production server to divine what assemblies are indeed deployed!
What Works Versus What Makes You Feel Cool
Sensei wants to direct you to a solution where a developer needed to use two versions of Json.Net with RavenDB. His solution: add dependentAssembly tag to the web.config, upload the file to a sub directory of the bin folder, and move on.
Ok, so it’s not cool, but the job is done. And that should be the whole point. Why use tools that put us in this mess in the first place? Unfortunately NuGet is becoming the primary way to get assemblies. The road may go ever on but projects have a deadline!! Poor Smeagul.