question

ZunaidValley-9242 avatar image
0 Votes"
ZunaidValley-9242 asked JoyQiao-MSFT commented

.NETCORE Application Deploy issue


Hi There

We have a .net core application when we deploy to our dev server gives error below:

===================================================
Category: Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware
EventId: 3
RequestId: 80000b02-0000-e400-b63f-84710c7967bb
RequestPath: /**/swagger/index.html
SpanId: |294f0971-44d42f9ab4216cc8.
TraceId: 294f0971-44d42f9ab4216cc8
ParentId:

Failed to determine the https port for redirect.



Any help would be appreciated.
Thank You and stay safe
Kind Regards

windows-server-2012
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

JoyQiao-MSFT avatar image
0 Votes"
JoyQiao-MSFT answered JoyQiao-MSFT commented

Hi,

According to the error message, I guess you used HttpsRedirection middleware in your application. It seems that you missed setting the https binding for your asp.net core application.

The HttpsRedirection middleware will check if you have set the https binding for your application.

Since I don’t know how you host your application in your server, I suggest you could try to comment out the app.UseHttpsRedirection(); in your application and deploy again, this may solve your issue.

If you still want to use https in your application, I suggest you could follow below article to set the https bindings.

Kestrel server: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/servers/kestrel?view=aspnetcore-5.0#configureiconfiguration

IIS: https://support.microsoft.com/en-us/help/324069/how-to-set-up-an-https-service-in-iis

Bests,

============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi,

May I know if my information provided in several days ago was useful for you?

If yes, please kindly mark it as answer. Which will help for other customers to find right direction more effectively.

Bests,

============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 Votes 0 ·