In the launchSettings.json
file, move the https
property to the top of the http
property. Both of them will work and http requests will be redirected to the https port (as long as you don't disable the UseHttpsRedirection()
in the Program.cs
file).
How to fix this error "warn: Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware[3] Failed to determine the https port for redirect."
Vaishnavi P
80
Reputation points
Good evening , I am trying to build a simple web api using ASP.Net . The app has been showing the error like this after building it -
warn: Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware[3]
Failed to determine the https port for redirect.
I have built according to this documentation-
https://learn.microsoft.com/en-in/training/modules/build-web-api-aspnet-core/3-exercise-create-web-api
Developer technologies ASP.NET ASP.NET Core
4,815 questions
12 answers
Sort by: Most helpful
-
Deleted
This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
Comments have been turned off. Learn more
-
Habeebullahi Lawal 0 Reputation points
2025-01-24T10:40:15.7866667+00:00