Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.5k views
in Technique[技术] by (71.8m points)

azure - Infinity page loading when host ASP Net Core application in IIS

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.

enter image description here

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:

enter image description here

Please help, thanks.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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. binoutput.)
  3. Make sure approot untimes....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.

Project01inoutput
    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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...