I have a WPF application, which starts a ASP.NET core WEB API application.
When I start the WEB API project as the startup project with these configurations, it works fine for HTTPS. But, when I try to launch this application from WPF environment, it's not working for HTTPS.
Configurations:
- Web API configuration:
- In Startup.cs file:
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
services.Configure<MvcOptions>(options =>
{
options.Filters.Add(new RequireHttpsAttribute());
});
}
The Main method looks like this:
public static void InitHttpServer()
{
var host = new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>()
.UseUrls("https://localhost:44300/")
//.UseApplicationInsights()
.Build();
host.Run();
}
When I check the port using netstat command, it shows:
Postman says:
Neither the debugger on the action method in the application is being hit.
P.S. : When I revert the changes for HTTPS and try use HTTP, it works fine.
The main method for HTTP has different port and none of the configuration changes mentioned above.


