I have the following class on an ASP.NET MVC 5 site:
[assembly: OwinStartup(typeof(MVCSite.Startup))]
namespace MVCSite {
public partial class Startup {
public void Configuration(IAppBuilder application) {
application.UseCookieAuthentication(new CookieAuthenticationOptions {
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/Account/Login")
});
application.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);
}
}
}
And on Web.Config I have the following:
<add key="owin:AutomaticAppStartup" value="false"/>
I have a breakpoint inside Startup.Configuration but this does not fire ...
Any idea why?
It's usually happend because SystemWeb package is not installed on your project.
Use this command at your Package Manager Console:
In the other hand you may use this configuration on your app.config or web.config if the above solution is not work:
Try removing
[assembly: OwinStartup(typeof(MVCSite.Startup))]
and give a shotUsing
Is the answer.