HttpContext is NULL when running web app in IIS

后端 未结 1 1458
后悔当初
后悔当初 2021-01-02 13:22

I have two application, both running on the same Windows machine. One application is IdentityServer4, and the other is my own web application (Server side Blazor app).

相关标签:
1条回答
  • 2021-01-02 13:57

    If the HttpContext null-reference exception happens after deployment to Azure App Services or IIS, you might have forgotten to enable WebSockets.

    Here is the deal:

    If the app runs on Windows with IIS: WebSockets must be enabled.

    See the IIS/IIS Express support section.

    It seems that this is a prerequisite that you have to follow. I only recently discovered this myself after dealing with the same issue and deciding to publish my app to Azure from within Visual Studio. After I did so, Visual Studio gave me a nice warning telling me to enable WebSockets protocol on the Azure App Service.

    0 讨论(0)
提交回复
热议问题