.NETCORE Application Deploy issue

Zunaid Valley 1 Reputation point
2020-11-11T14:55:46.193+00:00

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
Windows Server 2012
A Microsoft server operating system that supports enterprise-level management, data storage, applications, and communications.
1,580 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Joy Qiao 4,891 Reputation points Microsoft Employee
    2020-11-12T08:34:39.313+00:00

    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://learn.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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.