Saturday, May 8, 2010

Enterprise Library Configuration error: The type attribute does not exist on the element name.

Last week I finally had some time to upgrade an old project from Enterprise Library 3.1 to Enterprise Library 4.0.  I got most issues solved immediately but one issue took a lot more time to solve. When running the application I got the following error:

System.Configuration.ConfigurationErrorsException, System.Configuration, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a Message : The type attribute does not exist on the element name.

After comparing a newly created Enterprise Library 4 config file with the existingconfig file, I found one important difference. When you are using the Enterprise Library cache manager you need to add type="Microsoft.Practices.EnterpriseLibrary.Caching.CacheManager, Microsoft.Practices.EnterpriseLibrary.Caching" attribute to all the <add/> elements in the <cacheManagers/> collection.

Or maybe it’s just time to move on to Enterprise Library 5.0.


Anonymous said...

Wow... I am struck by how I googled my problem and came up with a blog post that was 100% about my exact problem and contains nothing but the exact answer I need. Web perfection. This is exactly what Tim had in mind.

JSaunders said...

I agree with the above comment. This was my exact problem also.

Bebster said...

Above two comments - Snap
The solution, the whole solution and nothing but the solution

ankush said...

works like a charm