问题
I have recently installed Enterprise library 5.0 but I am unable to find "Microsoft.Practices.ObjectBuilder2.dll". I am working on CALTutorial where I will need this dll as reference.
Can anybody answer this?
Thanks, Omky
回答1:
There is breaking change in EntLib 5. The library help file mentioned about this which says that code for "Microsoft.Practices.ObjectBuilder2.dll" is included in Unity assembly hence no need of separate reference.
回答2:
In case anyone else has a similar issue, I am responsible for a project that uses the NetTiers templates to generate data/service layers. The templates were configured to use EntLib 4.1 and I updated them to use EntLib 5. For the most part this was successful but NetTiers defines a class EntityLocator that is derived from ObjectBuilder2.Locator. Unfortunately the Locator class was removed from ObjectBuilder in the EntLib 5 release of Unity.
To address this, and due to Locator being referenced in the NetTiers templates, the easiest solution for me was to download the Unity 1.2 source code which contains source for the Locator class. I extracted the Locator class into my own solution, and after adding a couple of minor dependencies (Guard.cs, and the Properties folder), fixing up some namespaces, and updating the templates, I was able to successfully generate the data/service layers for my project.
回答3:
There was same error. My unity version was 2.1.505.2
First downgrade Install-Package Unity -Version 2.1.505
and then upgrade Install-Package Unity -Version 2.1.505.2
It worked for me.
来源:https://stackoverflow.com/questions/6302379/microsoft-practices-objectbuilder2-dll-not-found-after-installing-enterprise-lib