OwinStartup没有启动...为什么? [英] OwinStartup not Starting ... Why?

查看:1097
本文介绍了OwinStartup没有启动...为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ASP.NET MVC 5个网站,以下类:

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

和上Web.Config中我有以下几点:

And on Web.Config I have the following:

<add key="owin:AutomaticAppStartup" value="false"/>

我有内部Startup.Configuration一个断点,但这不火...

I have a breakpoint inside Startup.Configuration but this does not fire ...

任何想法,为什么?

推荐答案

使用

<add key="owin:AutomaticAppStartup" value="true"/>

就是答案。

这篇关于OwinStartup没有启动...为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆