我有一个OWIN中间件,它在我的开发机(Win7)上的IIS7上工作正常。但是,当部署到2008服务器时,页面返回404错误。
我像这样连接中间件
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>());
}
}
使用中间件的代码可以在这里找到:https://github.com/AndersMalmgren/Knockout.Bootstrap.Demo。该网站作为虚拟应用程序托管在IIS默认网站下。编辑:我是否需要添加默认角色之外的任何角色?IIS试图使用StaticFile处理程序,这当然是错误的,为什么会发生这种情况?
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