Using Enterprise Library 4.1 in SharePoint 2007 development projects
Yes, you CAN use Enterprise Library 4.1 (https://msdn.microsoft.com/en-us/library/cc467894.aspx) in your SharePoint 2007 development projects. Here is how:
- Install .NET Framework 3.5 if it is not present on SharePoint servers. EntLib 4.1 is based on 3.5 framework.
- Enable 3.5 for MOSS applications. MOSS 2007 was released before 3.5, so even if you have 3.5 on the servers, it won't know it and take advantages of it until you ask it to. To let MOSS 2007 to leverage 3.5, you need to modify its web application's web.config. Here is a blog that you can follow: https://blogs.msdn.com/chabrook/archive/2008/06/11/enabling-moss-to-use-net-3-5.aspx
- Deploy Enterprise Library bits to the SharePoint servers. I would recommend GAC deployment. You also want to use the out-of-the-box signed DLLs.
- Now you can modify web.config of your web applications to use EntLib. I recommend to use the Enterprise Library Configuration Utility to manage your EntLib configurations. Of cause, you need use feature receiver or some other mechanisms to propagate the changes for multi-server farms.
- Enjoy EntLib!
I have a webcast on this topic on MSDN China at https://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?culture=en-US&EventID=1032420504&CountryCode=US. You are welcome to watch it if you happen to speak Mandarin Chinese.
Zewei Song, Ph.D.
MCPD, MCTS: .NET 3.5, MOSS AppDev, Configuration
Enterprise Services, Microsoft Corporation
Comments
Anonymous
April 27, 2010
Dear Zewei, Can Enterprise library 5.0 application blocks be used with SharePoint 2007 & 2010. thanks, YogaAnonymous
April 29, 2010
I haven't tested it yet. But it seems that it would work with both MOSS 2007 and SharePoint 2010. From EntLib 5.0's document: "...In addition, this release has been adapted to work with both Microsoft Visual Studio® 2008 and Microsoft Visual Studio 2010; and with the Microsoft .NET Framework versions 4.0 and 3.5 with Service Pack 1."Anonymous
March 09, 2011
Sir May i know how to use data validation block of Enterprise Library 5.0 with sharepoint 2007 infopath forms? Waiting for your response Thank you in advanceAnonymous
March 09, 2011
The comment has been removedAnonymous
March 21, 2011
Hi can i know whether Entlib 4.1 supports sharepoint 2010 also? any idea?