Owin中间件导致404服务器 [英] Owin Middleware results in 404 on server

查看:885
本文介绍了Owin中间件导致404服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个owin中间件它的作品在我的IIS7在我的开发机器(WIN7)。 但是,当部署到2008年服务器的页面返回404

我勾了这样的中间件

 公共静态类AppBuilderExtensions
{
    公共静态无效InitTemplateStore(这IAppBuilder应用程序,字符串的templatePath,字符串文件匹配)
    {
        TemplateStoreMiddleware.Init(的templatePath,文件匹配);
        app.Map(/模板,subApp => subApp.Use< TemplateStoreMiddleware>());
    }
}
 

使用中间件的code可以在这里找到

https://github.com/AndersMalmgren/Knockout.Bootstrap.Demo

该网站托管作为默认的Web站点上的IIS

下的虚拟应用程序

编辑:我是否需要添加任何角色出默认的

IIS被特林使用StaticFile处理这offcourse是错误的,为什么会这样?

 模块IIS Web核心
通知马prequestHandler
处理器StaticFile
错误code 0x80070002
请求的URL的http://本地主机:80 / knockout.bootstrap.demo /模板根=共享
物理路径C:\的Inetpub \ knockout.bootstrap.demo \模板
登录方法匿名
登录用户匿名
 

解决方案

对于OWIN中间件未按预期运行在IIS中的几个常见原因集成的管线。

  1. 检查您是否已经安装在你的项目Microsoft.Owin.Host.SystemWeb的NuGet包,并且其在应用程序中的bin文件夹。
  2. 是您​​的应用程序池一个V4.0集成模式一(最可能是这一个?)

<一个href="http://www.asp.net/aspnet/overview/owin-and-katana/owin-middleware-in-the-iis-integrated-pipeline">This文章能有所帮助。此外<一href="http://stackoverflow.com/questions/20058873/how-to-get-iis-to-recognize-owin-startup-class">this的问题,我认为这是与你相似。

I have a owin middle ware it works on my IIS7 on my dev machine (win7). But when deployed to a 2008 server the page returns 404

I hook up the middleware like this

public static class AppBuilderExtensions
{
    public static void InitTemplateStore(this IAppBuilder app, string templatePath, string fileMask)
    {
        TemplateStoreMiddleware.Init(templatePath, fileMask);
        app.Map("/templates", subApp => subApp.Use<TemplateStoreMiddleware>());
    }
}

The code that uses the middleware can be found here

https://github.com/AndersMalmgren/Knockout.Bootstrap.Demo

The site is hosted as an virtual app under the default web site on IIS

edit: Do I need to add any roles out of the default ones?

IIS is tring to use the StaticFile handler which offcourse is wrong, why is this happening?

Module  IIS Web Core
Notification    MapRequestHandler
Handler StaticFile
Error Code  0x80070002
Requested URL   http://localhost:80/knockout.bootstrap.demo/templates?root=shared
Physical Path   C:\inetpub\knockout.bootstrap.demo\templates
Logon Method    Anonymous
Logon User  Anonymous

解决方案

A few common reasons for a OWIN middleware not working as expected in IIS integrated pipeline.

  1. Check if you have Microsoft.Owin.Host.SystemWeb nuget package installed in your project and its in the bin folder of your app.
  2. Is your app pool a v4.0 Integrated mode one (most probably this one?)

This article can be of help. Also this question I believe is similar to yours.

这篇关于Owin中间件导致404服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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