Unfortunately, my project must run on .NET 3.5 for the time being. I have recompiled in 3.5 but had to comment out the line that uses dynamic, in CacheConfiguration, and just not use caching.
//dynamic attribute = Attribute.GetCustomAttribute(requestType, enableResponseCachingAttributeType);
Looking at this again, it seems like the following would work just as well:
var attribute = Attribute.GetCustomAttribute(requestType, enableResponseCachingAttributeType) as IEnableResponseCachingAttribute;
Since enableResponseCachingAttributeType is set in the concrete class (ServiceCacheConfiguration or ClientCacheConfiguration) to the correct attribute type, only the appropriate attributes would be found in each case.
Anyone see any problems with this?
Thanks!