Last post Aug 01, 2013 06:22 AM by sudhanshu.mishra
Apr 11, 2011 04:17 AM|ciupazMI|LINK
at page 17 of the book "Developer's Guide to Microsoft Enterprise Library" by Microsoft Press, there is the following code:
var theContainer = new UnityContainer().AddNewExtension<EnterpriseLibraryCoreExtension>();
but if I compile my WinForm I got this error:
Error 1 The type or namespace name 'EnterpriseLibraryCoreExtension' could not be found (are you missing a using directive or an assembly reference?) C:\Users\Luigi\Documents\Visual Studio 2008\Projects\FormLib5\FormLib5\Form1.cs 41 69 FormLib5
and I already have the following dll's:
What's wrong with it?
Thanks in advance.
Aug 01, 2013 06:22 AM|sudhanshu.mishra|LINK
This might be late for the original question, but for the benefit of people who land here from a Bing/Google search:
There are two possible reasons you are not able to see EnterpriseLibraryCoreExtension:
1) You are using EntLib 5.0 and
- You have not yet added a reference to the assembly Microsoft.Practices.EnterpriseLibrary.Common
- If you have that reference, you need to add a "using Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Unity"
2) You are using EntLib 6 - in this case, you'll never find the class as it has been discontinued
The way here is to use the Enterprise libraries Configuration API and accomplish your objectives.