This post will go through how to install Enterprise Library 6 binaries and configure Visual Studio 2012.
The easiest way to install Enterprise Library 6 is to use NuGet (see Installing NuGet for information on installing NuGet) . Right-click on Add References and select “Manage NuGet Packages…”. Then search for entlib6 and install the packages you wish.
However, in some situations you may wish to use alternative approaches. For example download the binaries in order to explicitly manage versions or have a standard library location for developers etc.
Download and Install Enterprise Library
The first step is to download the binaries. You can download the binaries EnterpriseLibrary6-binaries.exe from from http://www.microsoft.com/en-us/download/details.aspx?id=38789.
Next Run EnterpriseLibrary6-binaries.exe:
Select Yes (if you agree!). Then browse for the folder to install the binaries into. This can be any location you wish. For this example I will use C:\EntLib\EntLib6. This is one difference from previous releases. In previous releases an installer would actually install Enterprise Library into Windows but with EntLib6 the files are extracted to the target folder. The files will be unpacked and when done you should get a success message:
If we open up a command shell and browse to the location of unpacked files we will see the following:
If you’ve used Enterprise Library before you would probably notice that the actual assemblies have not been installed. A quick look at the ReadMe file will let you know that you need to download the binaries using the supplied script, install-packages.ps1.
Run the script by typing: powershell -File .\install-packages.ps1
Type Y and hit <ENTER>. You should receive message that the packages were successfully installed:
All assemblies are now in the current directory (e.g. C:\EntLib\EntLib6):
That completes the installation.
Assemblies can now be added as file references but how can we get good integration with Visual Studio 2012?
Visual 2012 Configuration
Along with downloading the assemblies into the target folder the previous steps also installed the NuGet packages locally. What can we do if we don’t want to be dependent on an internet connection to add Enterprise Library to our projects? One way is to create a local package source for Enterprise Library.
To do this open up Package Manager Settings (TOOLS->Library Package Manager-> Package Manager Settings):
Next go to Package Manager->Package Sources and add a new entry for EntLib6. Click Add, Enter a Name and a Source (where the NuGet packages were installed which in this example is C:\EntLib\EntLib6\.nuget\packages) and click Update:
Then click OK.
Now when opening Manage NuGet Packages
we can select the local EntLib6 Packages as the source of all Enterprise Library 6. (“local” could also be on a shared network folder if desired.)
Using the above approach we can still use NuGet to manage our local Enterprise Library binaries.
Add Reference Configuration
But what if we don’t want to mess around with NuGet and we just want to have the Enterprise Library assemblies appear in the list of assemblies in Add Reference (old school!)? To do this we can use the technique described in How to: Add or Remove References By Using the Add Reference Dialog Box.
The following is for Visual Studio 2012 64-bit version. As a privileged user, open up the Registry Editor (regedit) and browse to the appropriate .NET Version Key:
On my machine this is:
Add a New Key for EntLib6 and set the default value to the location where Enterprise Library 6 was installed (C:\EntLib\EntLib6\ in this example):
Now when adding a reference in VS2012 we should Enterprise Library 6 assemblies in the Extension list:
Unfortunately, this post turned out to be very long. The good news is that we’ve seen how to install Enterprise Library 6 and a few methods of configuring Visual Studio 2012 to easily use the blocks.
Also, note that we haven’t discussed installing Enterprise Library in the GAC. If you wish to install in the GAC then you would have to manually install the desired assemblies in to the GAC (e.g. gacutil or drag the assemblies into GAC).