It's official. NuGet is now my all-time
favourite Visual Studio Add-on.
The other day I was trying to upload a simple website to my
hosting platform, but was having trouble with the
dependencies. As it happens, the hosting environment doesn't
have MVC3 installed, or SqlServer Ce 4 for that matter. MVC
wasn't much of a problem, but the Ce database server on the other
hand - well. That's a different story.
Since the website was very simple in functionality - it provides
a form that users can fill out to be notified of developments for a
piece of real-estate in Melbourne's Yarra Valley region - and we
only had a day to build it, I thought the combination of MVC3 with
SqlServer Ce (we used the Code-First data model approach, which
worked out really well) would be a no-brainer.
That was until I proceeded to upload the database, and started
having to hunt around for all the necessary dll's. It wasn't
enough to just mark the dependencies so they would be copied to the
output directory, I actually had to go and manually hunt around for
additional dll's as well.
Nuget allows you to download and automatically set up additional
packages and libraries with ease. It takes care of the
dependencies, and updates your configuration files as well so you
can just start using the new functionality without having to worry
about web.config settings, for example.
So. I added the package for EFCodeFirst.SqlServerCompact
to the project, which resulted in all the dependencies being added
as well in one easy step, and then all I had to do was make a few
tweaks here and there and upload the changes. Too easy!
Thank you, NuGet, you've just made my life that much