Caching assembly in Source View is not found

Topics: Caching Application Block , General discussion
Jan 12, 2011 at 11:12 AM

I am developing an ASP.NET website in Visual Studio 2010 and using EntLib 5 (did not have any previous EntLib installations before on this development machine). Now everything is working fine when I run the website (logging, caching). But I have a strange problem: when I edit an aspx page or a usercontrol the '<%page ...' tag is blueish underlined with the following popup warning (in source/html view):

ASP.NET runtime error: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Caching, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))

I am also having a problem with format (html) code does not work anymore on pages having this warning.

I checked my dll references (nothing is installed in the GAC), the target framework  and the web.config.

Does anybody have a clue?



1. Below an extract of my web.config for the caching block 


    <section name="cachingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerSettings, Microsoft.Practices.EnterpriseLibrary.Caching, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />


<cachingConfiguration defaultCacheManager="Cache Manager">
  <add name="Cache Manager" type="Microsoft.Practices.EnterpriseLibrary.Caching.CacheManager, Microsoft.Practices.EnterpriseLibrary.Caching, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" expirationPollFrequencyInSeconds="60" maximumElementsInCacheBeforeScavenging="1000" numberToRemoveWhenScavenging="10" backingStoreName="NullBackingStore" />
  <add type="Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations.NullBackingStore, Microsoft.Practices.EnterpriseLibrary.Caching, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="NullBackingStore" />

2. And an extract of my references (only for caching):

    <Reference Include="Microsoft.Practices.EnterpriseLibrary.Caching, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">      <SpecificVersion>False</SpecificVersion>      <HintPath>..\WUR.Nemabase.ThirdParty\Entlib\Microsoft.Practices.EnterpriseLibrary.Caching.dll</HintPath>    </Reference>    
<Reference Include="Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">      <SpecificVersion>False</SpecificVersion>      <HintPath>..\WUR.Nemabase.ThirdParty\Entlib\Microsoft.Practices.EnterpriseLibrary.Common.dll</HintPath>    </Reference>    
Jan 13, 2011 at 1:22 AM

Please see if this thread helps.


Sarah Urmeneta
Global Technologies and Solutions
Avanade, Inc.

Jan 14, 2011 at 8:27 AM

Thanks for your help, I did not found a solution yet because for my project I have wrapped the logging and caching inside a Class Library which I inject using  Dependency Injection. But at least I now know where to look for.

If I find the cause I will yet you know.




Jan 19, 2011 at 2:40 PM

If it helps anyone else: I installed dll's into the cache and my problem vanished, but it does not seem to be related to the Entlib because after adding all the additional (third party) dll's of the above mentioned Class Library I needed to add to the GAC too...