Microsoft.Owin.Host.SystemWeb on Mono/XSP
Asked Answered
S

1

8

I've managed to get Katana/OWIN running on Mono using the HttpListener host.

I'm now experimenting with Microsoft.Owin.Host.SystemWeb on Mono and XSP4. I'm using the code found in the this repo. It has a Startup class:

using Owin;

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

In web.config, we define the Configuration() method as that one that starts the app:

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

This works great when debugging in Visual Studio, but not on Mono. I'm guessing it's some sort of assembly-loading hook that doesn't get fired. Any suggestions?

Here's an app running the code: http://peaceful-forest-6785.herokuapp.com/

Full source code.

Schlep answered 28/7, 2013 at 23:32 Comment(1)
hi friism, have you got it work yet? I'm trying to run the MVC WebApplication template with SignalR that uses Microsoft.Owin.Host.SystemWeb (not self-host) and I couldn't even get the Startup.Configuration() loaded in Mono (Visual Studio 2013 works). I wonder if you have got it work or not. Thanks.Albata
H
0

I get this to work by telling XSP which is the Startup class and method via assembly attribute:

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();
        }
    }
}

I have also created a pull pull request with this fix in the repo.

Herne answered 13/5, 2016 at 13:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.