Implementing App.Config in Microsoft Application Blocks

G

Guest

Problem Scenario:

I have copied the Microsoft Cache Application Block (MCAB) dll to GAC to make that available to other applications. The MCAB uses few configuration settings which will be set in the client application App.config file. Basically the MCAB makes use of App.Config which exists in referenced application. As i have put MCAB dll in GAC it throws an error like this

Exception Type: System.Configuration.ConfigurationException
Message: Could not create Microsoft.ApplicationBlocks.Cache.CacheConfigurationHandler,Microsoft.ApplicationBlocks.Cache
BareMessage: Could not create Microsoft.ApplicationBlocks.Cache.CacheConfigurationHandler,Microsoft.ApplicationBlocks.Cache
Filename: NULL
Line: 0
TargetSite: System.Configuration.IConfigurationSectionHandler GetFactory(System.String)
HelpLink: NULL
Source: System

But when i put the MCAB dll as private to the referenced application it works. I guess this client application is not able to create instance of MCAB class when it MCAB in GAC.

Please correct me if i am wrong. Do respond ASAP.

Thanks,
Manikandan S
 
G

Guest

Hi Mani

try to add the following tokens in the CacheManagerSettings section declaration:
- Version = <the version of the dll in GAC
- Culture = neutra
- PublicKeyToken = <the public key token of the dll in the GAC

Following an example
<configSections><section name="CacheManagerSettings" type="Microsoft.ApplicationBlocks.Cache.CacheConfigurationHandler,Microsoft.ApplicationBlocks.Cache, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8b9ec1572e9dbf65" /></configSections

Hope this help
Luc

----- Mani wrote: ----

Problem Scenario:

I have copied the Microsoft Cache Application Block (MCAB) dll to GAC to make that available to other applications. The MCAB uses few configuration settings which will be set in the client application App.config file. Basically the MCAB makes use of App.Config which exists in referenced application. As i have put MCAB dll in GAC it throws an error like thi

Exception Type: System.Configuration.ConfigurationExceptio
Message: Could not create Microsoft.ApplicationBlocks.Cache.CacheConfigurationHandler,Microsoft.ApplicationBlocks.Cach
BareMessage: Could not create Microsoft.ApplicationBlocks.Cache.CacheConfigurationHandler,Microsoft.ApplicationBlocks.Cach
Filename: NUL
Line:
TargetSite: System.Configuration.IConfigurationSectionHandler GetFactory(System.String
HelpLink: NUL
Source: Syste

But when i put the MCAB dll as private to the referenced application it works. I guess this client application is not able to create instance of MCAB class when it MCAB in GAC.

Please correct me if i am wrong. Do respond ASAP

Thanks
Manikandan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top