Yes, you CAN use Enterprise Library 4.1 (http://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: http://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 http://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