ASP.NET 5 Web应用程序可与web.cmd,但不是在IIS应用程序 [英] ASP.NET 5 web application works with web.cmd, but not under IIS Application

查看:202
本文介绍了ASP.NET 5 Web应用程序可与web.cmd,但不是在IIS应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ASP.NET应用程序5,在 DNX-CLR-双赢x64.1.0.0-RC1-UPDATE1



出版

我跟着这篇文章将其部署到IIS 8.5。



当我手动使用它的web.cmd运行 - 它的工作原理



但是当我运行在IIS下,它发出的 HTTP 404(未找到)



可能是什么造成这种情况的原因是什么?



这是IIS安装我使用。



这是在web.config:



<预类=片段 - 代码HTML语言,HTML prettyprint-覆盖> <结构> < system.webServer> <&处理GT; <添加名称=httpplatformhandler路径=*动词=*的模块=httpPlatformHandler= resourceType为未指定/> < /处理器> < httpPlatform processPath =.. \approot\web.cmd参数=stdoutLogEnabled =假stdoutLogFile =.. \logs\stdout.logstartupTimeLimit =3600>< / httpPlatform> < /system.webServer>< /结构>



和该project.json:



<预类=片段码 - JS郎JS prettyprint-覆盖> {版本:1.0.0- *,compilationOptions:{emitEntryPoint:真正} 依赖:{Microsoft.AspNet.Diagnostics:1.0.0-RC1决赛,Microsoft.AspNet.IISPlatformHandler:1.0.0-RC1决赛,Microsoft.AspNet.Mvc: 6.0.0-RC1决赛,Microsoft.AspNet.Mvc.Core:6.0.0-RC1决赛,Microsoft.AspNet.Server.Kestrel:1.0.0-RC1决赛 Microsoft.AspNet.StaticFiles:1.0.0-RC1决赛,Microsoft.VisualStudio.Web.BrowserLink.Loader:14.0.0-RC1决赛,Microsoft.AspNet.Mvc.TagHelpers: 6.0.0-RC1决赛,Nummularii.Common.dll:1.0.0},命令:{网络:Microsoft.AspNet.Server.Kestrel},框架:{ dnx451:{依赖:{Admin.Common:1.0.0- *},frameworkAssemblies:{System.ServiceModel:4.0.0.0}}},排除:[ wwwroot文件,node_modules,bower_components],脚本:{prepublish:故宫安装,亭子安装],准备:一饮而尽},publishExclude:* *。用户,**。vspscc]}


解决方案

原来没有在RC1中的错误当Web应用程序是一个虚拟目录(在我的情况下,管理员)下。



请参阅以下链接一个解决方法



beta8发布的应用不运行在IIS上7.5


I have an ASP.NET 5 application, published under dnx-clr-win-x64.1.0.0-rc1-update1.

I followed this article to deploy it to IIS 8.5.

When I run it using the web.cmd manually - it works.

But when I run it under IIS, it emits HTTP 404 (Not Found).

What could be the cause for that?

This is the IIS setup I am using.

This is the 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>

And the 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"
  ]
}

解决方案

It turns out there is a bug in RC1 when the web application is under a virtual directory ('admin' in my case).

See the following link for a workaround

beta8 published app doesn't run on IIS 7.5

这篇关于ASP.NET 5 Web应用程序可与web.cmd,但不是在IIS应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆