zoukankan      html  css  js  c++  java
  • No 'Configuration' method was found in class 'WebApp.Startup

    The following errors occurred while attempting to load the app.
    - No 'Configuration' method was found in class 'WebApp.Startup, WebApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
    To disable OWIN startup discovery, add the appSetting owin:AutomaticAppStartup with a value of "false" in your web.config.
    To specify the OWIN startup Assembly, Class, or Method, add the appSetting owin:AppStartup with the fully qualified startup class or configuration method name in your web.config.

    解决办法:

    添加Startup 类

        public partial class Startup
        {
            // 有关配置身份验证的详细信息,请访问 http://go.microsoft.com/fwlink/?LinkId=301864
            public void ConfigureAuth(IAppBuilder app)
            {
                AntiForgeryConfig.UniqueClaimTypeIdentifier = ClaimTypes.Name;
                app.UseCookieAuthentication(new CookieAuthenticationOptions
                {
                    AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
                    LoginPath = new PathString(IdentityExtention.AuthUrl)
                });
            }
        }
    

    添加调用

    [assembly: OwinStartup(typeof(WebApp.Startup))]
    
    namespace WebApp
    {
        public partial class Startup
        {
            public void Configuration(IAppBuilder app)
            {
                ConfigureAuth(app);
            }
        }
    }
    

      

  • 相关阅读:
    ReentrantLock的实现语义与使用场景
    队列同步器详解
    设计模式--模板方法模式
    Synchronized及其实现原理
    JAVA线程基础
    JAVA内存模型
    java 线上问题定位工具
    JMX超详细解读
    Hexo
    [转]html5 video在安卓大部分浏览器包括微信最顶层的问题
  • 原文地址:https://www.cnblogs.com/bamboo-zhang/p/9461547.html
Copyright © 2011-2022 走看看