Enterprise Library 5.0 in SharePoint 2010

Topics: Exception Handling Application Block
Jan 31, 2011 at 10:26 AM

I downloaded and installed Enterprise Library 5.0. I wrote code to log exception in Windows Log event. I created an ASP.Net website in Visual Studio 2010, added refernce to the dll's of Enterprise Library. Using Entlib Config i set the configurations for Excetion handling and logging. This works fine and the exception has been logged in to Event Log. When i use the same settings and Configuration in Visual Studio 2010 Share Point 2010 web part i am getting the following error.

"Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified."

Note: In windows application and web application Enterprise Lib works good for me but in SharePoint 2010 web part i got the error.

Please help in solving this.

Feb 1, 2011 at 1:49 AM

Personally, I haven't work with any Sharepoint Project yet. Though below are some related thread that I think has the same problem like yours. HTH.

http://entlib.codeplex.com/Thread/View.aspx?ThreadId=213445

http://entlib.codeplex.com/Thread/View.aspx?ThreadId=236154

http://www.codeproject.com/KB/sharepoint/MSEL_in_Sharepoint.aspx

http://stackoverflow.com/questions/185621/sharepoint-and-enterprise-library-4-0

Gino Terrado
Global Technologies and Solutions
Avanade, Inc.
entlib.support@avanade.com