I want to use the new MemoryCache class but I am not yet using .NET 4. I do have a simple cache class (internally uses a dictionary). What would be a good approach in using this class like the MemoryCache? Does anyone know how MemoryCache is managed throughout the lifetime of an application (non asp.net)?
Maybe you can use a tool like Structuremap for that? It's not really meant to do these things (it's a DI container) but it will work out well if you specify some items as a singleton, some items on a request basis etc. It just depends on how granular you want the lifetime management to be.