问题
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,
- Application is running successfully from Visual Studio and dnx web.
- Insert logs in the startup (send emails), no logs where created.
- 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.
- Publish your web application (e.g.
dnu publish.) - Navigate to the publish output directory (e.g.
bin\output\.) - Make sure
approot\runtimes\..\..\dnx.exeis 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