EasyObjects now with Nuget

by mgnoonan 5. February 2011 23:45

nuget_logo

Never let it be said there wasn’t a bandwagon we couldn’t jump on… Winking smile

After years of manually adding configuration settings and copying files into projects, we finally have a better option. You can now add EasyObjects 2.0 to your projects using Nuget, or the Library Package Manager as it is known in Visual Studio 2010. As you create a new project, go to the Package Manager Console, and type “Install-Package EasyObjects.NET”. It should look something like this:

Package Manager Console

Isn’t that nice? Nuget automatically downloaded and installed the EntLib.DAAB package, which is a dependency, as well as the EasyObjects.NET package. But the goodness doesn’t stop there! A quick glance at web.config shows that the sections required to use EasyObjects have been added as well.

<dataConfiguration defaultDatabase="" />
  <dynamicQueryConfiguration defaultProvider="SQL Server 2005">
    <dynamicQueryProviders>
      <add name="SQL Server" type="NCI.EasyObjects.DynamicQueryProvider.SqlServerDynamicQuery, NCI.EasyObjects" />
      <add name="SQL Server 2005" type="NCI.EasyObjects.DynamicQueryProvider.Sql2005DynamicQuery, NCI.EasyObjects" />
      <add name="Oracle" type="NCI.EasyObjects.DynamicQueryProvider.OracleDynamicQuery, NCI.EasyObjects" />
    </dynamicQueryProviders>
  </dynamicQueryConfiguration>

That is just too cool!

But which version of the Enterprise Library?

Since there are several versions of the Enterprise Library, which version is getting installed? The answer is: it depends. If your project is set to build against the .NET 2.0 framework, then the version that gets installed is the EntLib 3.1. If your project is targeting the .NET 3.5 framework (or higher), then the EntLib 4.1 is used.

Unfortunately, there isn’t a version of EO for the EntLib 5.0 yet, so that version will not be installed. You should also be aware that only the files necessary for the Data Access Application Block will be installed. None of the other blocks are included, and neither is the Configuration Tool. You’ll have to download the full EntLib to get those.

Why isn’t EasyObjects 1.2 included in the package?

I struggled to work this out for a long time, even opening up a discussion on the Nuget forums on Codeplex to try and nail the specifics. While Nuget does officially support .NET 1.1 libraries, there’s no clear way to modify .NET 1.1 project files to add EasyObjects 1.2 support. And realistically, if you were going to start a new web project today, would you really fire up Visual Studio 2003 and .NET 1.1? Probably not. It’s a shame, in a way, because EasyObjects 1.2 with all its separate config files would have benefitted the most from the Nuget approach. But it was not to be…

EntLib.DAAB

Just a quick word about the EntLib.DAAB package, since this is an important dependency for EasyObjects. Unfortunately Microsoft has not published an official EntLib package for Nuget, so I had to come up with my own. These are the official signed DLLs for the EntLib, but my intention is to delete this package once Microsoft publishes their official version.

You can check out the EntLib.DAAB and EasyObjects packages out on the Nuget site, or just fire up Visual Studio and add them directly to your project!

Tags: , , , ,

EasyObjects.NET 2.0 | Nuget

Month List

Page List