【问题标题】:Infinity page loading when host ASP Net Core application in IIS在 IIS 中托管 ASP Net Core 应用程序时无限页面加载
【发布时间】:2016-07-25 11:34:28
【问题描述】:

您好,我的 ASP.Net Core 应用程序出现错误。我在 Azure CloudWindows Server 2012 上的 dnx451 框架上安装了两个 ASP.NET Core 网站。

当我在浏览器中导航到它们时,它们会无限加载。在它发生之前我安装了HttpPlatformHandler,因为以下错误,但现在我没有看到任何异常无限加载。

我在安装 HttpPlatformHandler 之前看到的错误。

还有,

  1. 应用程序正在从 Visual Studio 和 dnx web 成功运行。
  2. 在启动中插入日志(发送电子邮件),没有创建日志。
  3. 加载页面:

请帮忙,谢谢。

【问题讨论】:

标签: azure iis asp.net-web-api asp.net-core single-page-application


【解决方案1】:

简答

当 IIS 找不到 dnx.exe 时会发生无限加载。当发布无法在其输出中包含运行时时,就会发生这种情况。

解决方案

发布时使用--runtime 标志。

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.

运行时标志提供要包含的运行时文件夹的名称或完整路径,或active 用于 PATH 上的当前运行时。

如果发布输出中仍未包含runtimes 目录,则升级到最新版本的dnu,因为旧版本中存在错误。

说明

当 IIS 找不到 dnx.exe 时会发生无限加载。当发布无法在其输出中包含运行时时,就会发生这种情况。

这里是检查缺少的dnx.exe 是否导致无限加载问题的方法。

  1. 发布您的网络应用程序(例如dnu publish。)
  2. 导航到发布输出目录(例如bin\output\。)
  3. 确保approot\runtimes\..\..\dnx.exe 存在。

以下是发布输出必须包含的关键文件。为了清楚起见,我省略了其他一些重要文件。

\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

外部链接

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-06-08
    • 2021-08-19
    • 1970-01-01
    • 1970-01-01
    • 2020-09-23
    • 2021-11-04
    • 2021-09-25
    • 1970-01-01
    相关资源
    最近更新 更多