You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am in process of converting WCF based REST API service to ASP.NET WEB API hosted in IIS. When I try to instantiate System.Runtime.Caching.MemoryCache instance, it throws below error:
"Configuration system failed to initialize, Unrecognized configuration section system.web".
Is System.Runtime.Caching.MemoryCache allowed to be used in ASP.NET WEB API project?
If yes, how can I avoid above mentioned issue?
Note: I am aware of IMemoryCache in ASP.NET WEB API, but it does not exactly provide what I need. For instance, there is no limit on max memory it's allowed to be used. Also, it's sliding expiration removes an entry when it's getting accessed. I use System.Runtime.Caching.MemoryCache user session data (chart data/dataset etc. for user specific data analysis app), and cannot regenerate data, so we write data to disk when it gets removed from the cache and reload it to cache when user ask for it and cannot be found in the cache. IMemoryCache removes the data after it's being asked for, making it harder to make this work. This works perfectly fine in System.Runtime.Caching.MemoryCache implementatiion.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am in process of converting WCF based REST API service to ASP.NET WEB API hosted in IIS. When I try to instantiate System.Runtime.Caching.MemoryCache instance, it throws below error:
"Configuration system failed to initialize, Unrecognized configuration section system.web".
Note: I am aware of IMemoryCache in ASP.NET WEB API, but it does not exactly provide what I need. For instance, there is no limit on max memory it's allowed to be used. Also, it's sliding expiration removes an entry when it's getting accessed. I use System.Runtime.Caching.MemoryCache user session data (chart data/dataset etc. for user specific data analysis app), and cannot regenerate data, so we write data to disk when it gets removed from the cache and reload it to cache when user ask for it and cannot be found in the cache. IMemoryCache removes the data after it's being asked for, making it harder to make this work. This works perfectly fine in System.Runtime.Caching.MemoryCache implementatiion.
Beta Was this translation helpful? Give feedback.
All reactions