Cache Application block and Enterprise Library Configuration

Topics: Caching Application Block , Validation Application Block
May 27, 2008 at 12:23 PM
Hi all

I found that i have a problem on the enterprise library configuration.

I have opend web.config with the enterprise library configruation and create an Cache application block and it is fine.

But after I re-opened again. It shows the validate error and show the following error message?

Error 1 [A]Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerSettings cannot be cast to [B]Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerSettings. Type A originates from 'Microsoft.Practices.EnterpriseLibrary.Caching, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'LoadNeither' at location 'C:\Documents and Settings\user\Local Settings\Application Data\Microsoft\VisualStudio\9.0\ProjectAssemblies\dnmehzh801\Microsoft.Practices.EnterpriseLibrary.Caching.dll'. Type B originates from 'Microsoft.Practices.EnterpriseLibrary.Caching, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'LoadFrom' at location 'C:\Program Files\Microsoft Enterprise Library 4.0 - May 2008\Bin\Microsoft.Practices.EnterpriseLibrary.Caching.dll'.  0 0 AACommunity.UserApplication.MVC.WebApp

What it means and how to solve it?

May 27, 2008 at 3:16 PM

Hi,

Can you post the exact steps (type of app, how the config was opened, etc) and additiona error details like the stack trace if available?

Thanks,

Fernando


hnchan wrote:
Hi all

I found that i have a problem on the enterprise library configuration.

I have opend web.config with the enterprise library configruation and create an Cache application block and it is fine.

But after I re-opened again. It shows the validate error and show the following error message?

Error 1 [A]Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerSettings cannot be cast to [B]Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerSettings. Type A originates from 'Microsoft.Practices.EnterpriseLibrary.Caching, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'LoadNeither' at location 'C:\Documents and Settings\user\Local Settings\Application Data\Microsoft\VisualStudio\9.0\ProjectAssemblies\dnmehzh801\Microsoft.Practices.EnterpriseLibrary.Caching.dll'. Type B originates from 'Microsoft.Practices.EnterpriseLibrary.Caching, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'LoadFrom' at location 'C:\Program Files\Microsoft Enterprise Library 4.0 - May 2008\Bin\Microsoft.Practices.EnterpriseLibrary.Caching.dll'.  0 0 AACommunity.UserApplication.MVC.WebApp

What it means and how to solve it?




May 27, 2008 at 4:09 PM
It is a MVC Preview 2 project and I open it with the Enterprise Library Configuration under Design time.

Just FYI, Before I installed Enterprise Library 4.0. I have installed 3.1 into VS2008 with the registry for open the web.config with Enterprise Library configuration 3.1 imported to VS2008.

I don't have any stack trace since it is design time.

Anymore information needed?

Thanks.
May 27, 2008 at 4:20 PM
It is a MVC Preview 2 project and I open it with the Enterprise Library Configuration under Design time.

Just FYI, Before I installed Enterprise Library 4.0. I have installed 3.1 into VS2008 with the registry for open the web.config with Enterprise Library configuration 3.1 imported to VS2008.

I don't have any stack trace since it is design time.

Anymore information needed?

Thanks.
May 27, 2008 at 4:22 PM

Hi,

A sequence of steps to reproduce the issue from scratch would be great. Eg:

  1. Create a new [app type] project
  2. Open the web.config with the configuration tool
  3. Add such and such configuration
  4. Save and close the file
  5. Add such and such code
  6. Run the app
  7. Open the web config
  8. etc

Thanks,
Fernando


hnchan wrote:
It is a MVC Preview 2 project and I open it with the Enterprise Library Configuration under Design time.

Just FYI, Before I installed Enterprise Library 4.0. I have installed 3.1 into VS2008 with the registry for open the web.config with Enterprise Library configuration 3.1 imported to VS2008.

I don't have any stack trace since it is design time.

Anymore information needed?

Thanks.


May 28, 2008 at 9:14 AM
Thanks Fernando

BTW, I reinstall the Enterprise Library and it works fine now.

Anyway, I don't know why but the problem solved.

Mar 25, 2009 at 10:56 AM
Thx for this post, guys!
I had the same problem like hnchan, just concerning Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.dll in my case.

Reinstallation of EnterpriseLibrary 4.1 fixed the issue :)

Have a nice day,
Harry