Trouble initializing services from .NET Core MVC web app in console app - dependency injection issue

30 views Asked by At

I'm implementing a console application in .net core 2.2 inside a mvc project of a web application always in .net core 2.2. My difficulty is in initializing the services contained in the web application inside my console application. Do you have any solution?

I took inspiration from these sites but it doesn't work: https://pradeepl.com/blog/dotnet/configuration-in-a-net-core-console-application/

https://andrewlock.net/using-dependency-injection-in-a-net-core-console-application/

https://learn.microsoft.com/en-us/dotnet/core/extensions/dependency-injection-usage

0

There are 0 answers