Unity configuration error

Feb 14, 2011 at 6:52 AM

When I navigate to my site , I'm getting the following error:

"An error occurred creating the configuration section handler for unity: Could not load file or assembly "Mircosoft.Pratices.Unity.Configuration" or one its dependencies.

The system cannot find the file specified"

Any ideas?

Feb 14, 2011 at 6:55 AM

From where are you referencing the Unity.Configuration assembly?  From a specific folder or from GAC?  To double check, click on the Unity.Configuration assembly reference, see if the Copy Local property is set to True.  If not, then it's trying to load the assembly from GAC. 

 

Sarah Urmeneta
Global Technologies and Solutions
Avanade, Inc.
entlib.support@avanade.com

Feb 14, 2011 at 9:26 AM

I was referencing it for a local folder in the solution. the "Copy local" property as set to true but for some reason , the file wasn't copied to the bin folder.

Once i've copied it manually it worked fine. Any Ideas?

Feb 14, 2011 at 10:38 PM

It has something to do with how the build process works.  Fernando explained this scenario in this thread in the EntLib forum (refer to his second reply).  The assembly didn't get copied to the output folder because you didn't referenced any types from that assembly in your code.  If it's not really necessary for you to have a code reference to that assembly, the suggested way to have it available in the output folder is to manually copy it or create a post build event in your project which automates the deploying of the assembly to the output folder.

 

Sarah Urmeneta
Global Technologies and Solutions
Avanade, Inc.
entlib.support@avanade.com