Error using Microsoft Application Block cache -
11-16-2004
, 09:59 AM
Hi all,
I'm using Microsoft Applications cache block in my web application. It
worked fine for sometime then suddenly it is raising the following error:
Message: "Can't validate the current data item. Maybe it was altered."
Source: "Microsoft.ApplicationBlocks.Cache"
StackTrace: "at
Microsoft.ApplicationBlocks.Cache.DataProtectionMa nager.RemoveMAC(Byte[]
binaryMacValue) in
C:\Inetpub\wwwroot\myApp\ApplicationBuildingBlocks \Microsoft.ApplicationBlocks.Cache\DataProtectionM anager.vb:line 260
at
Microsoft.ApplicationBlocks.Cache.Storages.MmfCach eStorage.GetData(String
key) in
C:\Inetpub\wwwroot\myApp\ApplicationBuildingBlocks \Microsoft.ApplicationBlocks.Cache\StorageImplemen tations\MmfCacheStorage.vb:line 447
at Microsoft.ApplicationBlocks.Cache.CacheManager.Get Data(String key) in
C:\Inetpub\wwwroot\myApp\ApplicationBuildingBlocks \Microsoft.ApplicationBlocks.Cache\CacheManager.vb :line 310
at Microsoft.ApplicationBlocks.Cache.CacheManager.get _Item(String key) in
C:\Inetpub\wwwroot\myApp\ApplicationBuildingBlocks \Microsoft.ApplicationBlocks.Cache\CacheManager.vb :line 128
For storage location i'm using mmfcacheStorage
The message shows that data item is altered but it is not altered and i'm
using the following code.
Dim cacheCountry As CacheManager = CacheManager.GetCacheManager()
If cacheCountry.Item("countryCache") Is Nothing Then 'Error line'
' Add data into cache'
cacheCountry.Add("countryCache", countries)
else
'Assign cache data to a varible
getCountries = CType(cacheCountry.Item("countryCache"), countryClass)
End if
Is there someting wrong with code?
looking forward to your reply
Regards
Aamir |