jlt*_*rem 4 iis-7.5 kestrel-http-server asp.net-core
我正在将一些应用程序从ASP.NET 5 beta7迁移到RC1.使用HTTPPlatformHandler我可以运行任何这些ASP.NET 5 RC1应用程序作为IIS站点的根目录.但它们不会作为网站的子目录(右键单击"添加应用程序")运行.完整的回复显示:
HTTP/1.1 404 Not Found
Content-Length: 0
Server: Kestrel
X-Powered-By: ASP.NET
Date: Tue, 24 Nov 2015 14:59:04 GMT
Run Code Online (Sandbox Code Playgroud)
这不是权限问题,因为当应用程序是站点的根目录并使用相同的应用程序池时,路由会成功提供.
应用程序池配置为"无托管代码"和集成管道.
root应用程序的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>
Run Code Online (Sandbox Code Playgroud)
对于子应用程序,我必须删除httpplatformhandler处理程序以避免错误"无法添加类型为'add'的重复集合条目,并将唯一键属性'name'设置为'httpplatformhandler'".
现在我们必须使用kestrel/httpplatformhandler,是否可以在站点下作为应用程序运行?
jlt*_*rem 10
这个问题始于beta8,在RC1中仍然是一个悬而未决的问题.请参阅ASP.NET IIS集成问题#14."那个问题即将到来." @davidfowl说."这是一个解决方法,直到修复程序可用.我们正在与httpPlatformHandler团队合作修复beta8和rc1中发现的错误."
解决方法是映射IIS应用程序路径,Startup.Configure如下所示:
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
app.Map("/MyAppPath", (myAppPath) => this.ConfigureMyAppPath(myAppPath, env));
}
public void ConfigureMyAppPath(IApplicationBuilder app, IHostingEnvironment env)
{
// the actual Configure code
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1540 次 |
| 最近记录: |