Enterprise Library and SSRS

Topics: Caching Application Block , Logging Application Block
Feb 14, 2007 at 12:52 AM

We are currently working on a SQL Server Reporting Services 2005 project, and are developing a custom assembly which will grab data from secondary data sources to fill in reports. We have used Enterprise Library Caching, Data Access, and Logging on many of our other projects and would love to get it working in this custom assembly.

Working in our development environment is a little quirky, as the devenv.exe.config file must be altered in order to store configuration settings needed by the custom assembly. We have successfully gotten the Data Access part to work (using connection strings), but cannot resolve errors that occur with the Logging and Caching application blocks. It seems that the configuration settings simply don't get picked up when running a Reporting Services project, even though they are in the same place as our connection strings are.

Specifically, the Caching block throws a null argument exception on the call to chain.Head.BuildUp in the Microsoft.Practices.ObjectBuilder.BuilderBase<TStageEnum>.DoBuildUp method.

The Logging block throws a logging section not found exception after it can't get the logging settings from the IConfigurationSource (which does point to devenv.exe.config).

Has anyone been able to get these two blocks working with a custom assembly in SQL Server Reporting Services? Any help would be greatly appreciated.
Feb 14, 2007 at 2:24 PM
I wish I could be of help, but I have never tried it before.

It sounds like the configuration information for the logging and caching blocks needs to be somewhere else than where it is for the DAAB, but I don't know where that would be. It sounds like you are using SystemConfigurationSource, and perhaps you may want to use a FileConfigurationSource so you can specify the exact location of where the configuration information should be retrieved for the Caching and Logging blocks.




David Hayden
Microsoft MVP C#
Feb 15, 2007 at 12:56 AM
Thank you so much! That worked perfectly, I copied the generated app.config file to the folder that devenv.exe.config is in, and used a FileConfigurationSource to create my factories.

Works perfectly now, your help is greatly appreciated.