Infinity page loading when host ASP Net Core application in IIS

 ̄綄美尐妖づ 提交于 2020-01-10 05:54:06

问题


Good day, I have an error with my ASP.Net Core application. I have installed two ASP.NET Core web sites on dnx451 framework on Windows Server 2012 in the Azure Cloud.

When I navigate to them in browser, they are infinitely loading. Before it happened I installed HttpPlatformHandler because of the following error, but right now I don't see anything exception infinite loading.

Error that I see before install HttpPlatformHandler.

Also,

  1. Application is running successfully from Visual Studio and dnx web.
  2. Insert logs in the startup (send emails), no logs where created.
  3. Loading page:

Please help, thanks.


回答1:


Short Answer

Infinite loading occurs when IIS cannot find dnx.exe. That happens when the publish fails to include runtimes in its output.

Solution

Use the --runtime flag when publishing.

cd Project01
dnvm use 1.0.0-rc1-final -runtime clr   <------ Set the active runtime.
dnu build
dnu publish --runtime active            <------ Use the runtime flag.

The runtime flag provides the name or full path of the runtime folder to include, or active for the current runtime on the PATH.

If that still doesn't include the runtimes directory in the publish output, then upgrade to the most recent release of dnu, because there is a bug in older versions.

Explanation

Infinite loading occurs when IIS cannot find dnx.exe. That happens when the publish fails to include runtimes in its output.

Here is how to check whether a missing dnx.exe is causing the infinite loading problem.

  1. Publish your web application (e.g. dnu publish.)
  2. Navigate to the publish output directory (e.g. bin\output\.)
  3. Make sure approot\runtimes\..\..\dnx.exe is present.

Here are the key files that the publish output must contain. I've omitted some other important files to for clarity.

\Project01\bin\output\
    approot
        packages         
        runtimes <--------------------------------This is sometimes missing.
            dnx-clr-win-x64.1.0.0-rc1-final
                bin
                    dnx.exe <---------------------IIS needs to find this.
        src              
        global.json      
        web              
        web.cmd              
    logs
    wwwroot <-------------------------------------IIS Physical Path

External Links

  • https://github.com/aspnet/Hosting/issues/364#issuecomment-148567294
  • https://github.com/aspnet/dnx/issues/2858


来源:https://stackoverflow.com/questions/36427855/infinity-page-loading-when-host-asp-net-core-application-in-iis

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!