Mono / XSP上的Microsoft.Owin.Host.SystemWeb

我已经设法使用 HttpListener host让Katana / OWIN在Mono上运行.

我现在正在Mono和XSP4上试验Microsoft.Owin.Host.SystemWeb.我正在使用this repo中的代码.它有一个Startup class

using Owin;

namespace KatanaSystemWebTest
{
    public class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            app.UseDiagnosticsPage();
        }
    }
}

web.config中,我们将Configuration()方法定义为启动应用程序的方法

<appSettings>
    <add key="owin:AppStartup" value="KatanaSystemWebTest.Startup.Configuration,KatanaSystemWebTest" />
    <add key="owin:AutomaticAppStartup" value="true" />
    <add key="webpages:Enabled" value="false" />
</appSettings>

这在Visual Studio中调试时效果很好,但在Mono上没有.我猜它是某种不会被解雇的程序集加载钩子.有什么建议?

这是运行代码的应用程序:http://peaceful-forest-6785.herokuapp.com/

Full source code.

我通过使用程序集属性告诉XSP哪个是Startup类和方法来实现这一点:
using Owin;
using Microsoft.Owin; // <--- this is new

// this is new:
[assembly: OwinStartup (typeof (KatanaSystemWebTest.Startup),"Configuration")]

namespace KatanaSystemWebTest
{
    public class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            app.UseDiagnosticsPage();
        }
    }
}

我还在repo中创建了一个pull pull请求.

相关文章

Windows2012R2备用域控搭建 前置操作 域控主域控的主dns:自...
主域控角色迁移和夺取(转载) 转载自:http://yupeizhi.blo...
Windows2012R2 NTP时间同步 Windows2012R2里没有了internet时...
Windows注册表操作基础代码 Windows下对注册表进行操作使用的...
黑客常用WinAPI函数整理之前的博客写了很多关于Windows编程的...
一个简单的Windows Socket可复用框架说起网络编程,无非是建...