Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OWIN StartUp not working

Tags:

c#

owin

I've declared the following in my application:

[assembly: OwinStartup("MyClass", typeof(MyClass), "ConfigureOwin")]

Defined a startup class:

public class MyClass {

    public void ConfigureOwin(IAppBuilder appBuilder) {

    }

}

And start owin like this:

WebApp.Start<MyClass>("baseUri");

However, it's not working. WebApp always tries to look for a method named 'Configuration' even if I define to look for something else. What could I do?

like image 294
Acrotygma Avatar asked Mar 14 '14 12:03

Acrotygma


2 Answers

For me, I needed to add Microsoft.Owin.Host.SystemWeb as a reference. (Click Manage Nuget Packages and search for it.)

Thanks to this blog post for the tip.

I ran into this issue because I migrated from Web API to Web API with OWIN middleware for ADFS authentication.

like image 99
Jess Avatar answered Sep 21 '22 09:09

Jess


If you're using optimizeCompilations="true" in your web.config you may need to set it to false and back to true.

like image 32
joshschreuder Avatar answered Sep 18 '22 09:09

joshschreuder