Can I Use HttpClientFactory In A .NET.core App Which Is Not ASP.NET Core?
Answer : According to the documentation HttpClientFactory is a part of .Net Core 2.1, so you don't need ASP.NET to use it. And there some ways to use are described. The easiest way would be to use Microsoft.Extensions.DependencyInjection with AddHttpClient extension method. static void Main(string[] args) { var serviceProvider = new ServiceCollection().AddHttpClient().BuildServiceProvider(); var httpClientFactory = serviceProvider.GetService<IHttpClientFactory>(); var client = httpClientFactory.CreateClient(); } Thanks for replies. So it is possible to use in console app. There are a few ways to do this, depending on what way you want to go. Here are 2: Directly add to ServiceCollection e.g. services.AddHttpClient() Use Generic host e.g. Add httpclientFactory in .ConfigureServices() method See here for blog post using in console app As one of the answers suggests, you do not need ASP.NET to use it However, you need a bit of work to ge