I have a Web Api in Asp.Net Core 6 which calls another Web Api project in the same solution.
I have in my test:
FirstFactory<Program> firstFactory = new FirstFactory<Program>();
var firstClient = firstFactory.CreateClient();
SecondFactory<AnotherProject.Program> firstFactory = new SecondFactory<AnotherProject.Program>();
secondFactory.Server.BaseAddress = new Uri("https://localhost:7000");
var response = firstFactory.GetAsync("WeatherForecast");
It calls the first endpoint and when it gets to the second one, I get an exception: "No connection could be made because the target machine actively refused it".
What is causing this issue and how can it be solved?