F
F
FairyFox57002020-04-20 14:44:12
ASP.NET
FairyFox5700, 2020-04-20 14:44:12

How to start Redis server automatically in ASP NET CORE?

I use caching with Redis. But for it to work, you need to run the Redis server itself. Is it possible to launch it automatically when starting an ASP NET Core web application?
Or it assumes that at me the server will be started for example by other machine?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Ilya, 2020-04-20
@FairyFox5700

If you are using Redis as a cache for a distributed system, then it must be on a different machine, yes.
But if you have only 1 instance of your application, then you don’t really need Redis at all, because there is already RAM in the same process.

I
Ivan Shumov, 2020-04-20
@inoise

second option. infrastructure setup can be done in different ways: Docker, ansible, chef, terraform, k8s.... in general, 100500 different options. But the application code definitely has no right to be responsible for this.

V
Vladimir Korotenko, 2020-04-20
@firedragon

In the solution, add commands for the PreBuild step
for example net start redis

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question