Thursday, 23 October 2014


Share/Bookmark

Introduction

   I was working on a project which uses Enterprise Library to store cache data to database backing store and I encountered an exception as Activation error occurred while trying to get instance of type ICacheManager.
I believed I have the entire configuration done properly. But there was one important configuration missing. In this post we will see how to fix the exception which occurs while using Enterprise library to cache or log data to backing store say database or any backing store. This happens when we try to use database backing store and misses the steps which is required to setup database backing store. Now to have the database to hold the cache data, we need some tables and stored procedures.

How did I fix this exception

  Enterprise library will provide you with one command batch file which you need to run against your database. This batch file will run Sql commands against your database and will create the stored procedures and required tables. You can find this batch file at, “EntLib50Src\Blocks\Caching\Src\Database\Scripts”. This is just a relative path. Actual path may vary based on your installation. You can find two files here; one is CreateCachingDb.cmd which has command which will run one sql script which will create tables and stored procedures to your database. Second is CreateCachingDatabase.sql which will have sql query to create necessary stored procedures and tables. If you can’t find the scripts folder, then you may have to install the “Enterprise Library 5.0 - Source Code.msi” which comes along with Enterprise library 5.0 install.

Categories:

0 comments:

Post a Comment

Dear reader, Your comment is always appreciated. I will reply to your queries as soon as possible.

1. Make sure to click on the Subscribe By Email link to be notified of follow up comments and replies. Or you can use Subscribe to: Post Comments (Atom) link.
2. Only English comments shall be approved.
3. Please make your comments self-explanatory. Comment in such a way that it explains the comment so that a counter question can be avoided and can be replied with proper answer on the first go.