【问题标题】:ASP.NET 5 web application works with web.cmd, but not under IIS ApplicationASP.NET 5 Web 应用程序适用于 web.cmd,但不适用于 IIS 应用程序
【发布时间】:2016-03-29 15:43:28
【问题描述】:

我有一个 ASP.NET 5 应用程序,在 dnx-clr-win-x64.1.0.0-rc1-update1 下发布。

我按照this article 将其部署到 IIS 8.5。

当我使用 web.cmd 手动运行它时 - 它可以工作。

但是当我在 IIS 下运行它时,它会发出 HTTP 404 (Not Found)

这可能是什么原因?

This is the IIS setup我正在使用。

这是 web.config:

<configuration>
  <system.webServer>
    <handlers>
      <add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
    </handlers>
    <httpPlatform processPath="..\approot\web.cmd" arguments="" stdoutLogEnabled="false" stdoutLogFile="..\logs\stdout.log" startupTimeLimit="3600"></httpPlatform>
  </system.webServer>
</configuration>

还有project.json:

{
  "version": "1.0.0-*",
  "compilationOptions": {
    "emitEntryPoint": true
  },

  "dependencies": {
    "Microsoft.AspNet.Diagnostics": "1.0.0-rc1-final",
    "Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
    "Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
    "Microsoft.AspNet.Mvc.Core": "6.0.0-rc1-final",
    "Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
    "Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final",
    "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-rc1-final",
    "Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-final",
    "Nummularii.Common.dll": "1.0.0"
  },

  "commands": {
    "web": "Microsoft.AspNet.Server.Kestrel"
  },

  "frameworks": {
    "dnx451": {
      "dependencies": {
        "Admin.Common": "1.0.0-*"
      },
      "frameworkAssemblies": {
        "System.ServiceModel": "4.0.0.0"
      }
    }
  },

  "exclude": [
    "wwwroot",
    "node_modules",
    "bower_components"
  ],

  "scripts": {
    "prepublish": [ "npm install", "bower install" ],
    "prepare": "gulp"
  },

  "publishExclude": [
    "**.user",
    "**.vspscc"
  ]
}

【问题讨论】:

  • 我也有同样的问题。
  • @Fanda 看看我的回答..

标签: c# iis asp.net-core


【解决方案1】:

这有点远,但我想知道您是否在作为项目路径一部分的目录名称中有空格?在 RC1 中,这会阻止 IIS Express 运行 Web 应用程序。可能还有 IIS。在错误报告链的某些级别,这看起来像是一个文件未找到错误。但是在其他级别,它显示为“尝试确定托管您的应用程序的 DNX 进程的进程 ID 时发生错误。”

正如我所说,这有点远,因为它可能不是你的问题,但我认为值得一提,因为它可能是。

有关详细信息,请参阅此 github 问题:https://github.com/aspnet/Home/issues/1194

【讨论】:

    【解决方案2】:

    事实证明,当 Web 应用程序位于虚拟目录(在我的例子中为“admin”)下时,RC1 中存在错误。

    查看以下链接了解解决方法

    beta8 published app doesn't run on IIS 7.5

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-02
      • 1970-01-01
      • 2021-01-25
      • 1970-01-01
      • 1970-01-01
      • 2016-06-23
      相关资源
      最近更新 更多