Search code examples
azure-redis-cache

Install Redis Cache in Library Project


We have an MVC 5 WebApp and several class libraries all part of the same solution.

The WebApp is in Azure and we are using the StackExchange Redis as our caching.

We wanted to know if it is ok to add the Exchange Redis package to one of our class libraries instead of the WebApp. Will the connection string that is added to our Web.config file in the WebApp be accessible from our Library.

Many thanks


Solution

  • Yes. You can do it. But you just need to add this library into your Web App. Because you need to get the connection string from Web.config file.