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

      

  • 相关阅读:
    2021.10 好运气
    2021.9 抢购
    2021.8 全周期工程师
    2021.7 创业者
    2021.6 过年
    jenkins学习17
    httprunner 3.x学习18
    httprunner 3.x学习17
    python笔记57-@property源码解读与使用
    httprunner 3.x学习16
  • 原文地址:https://www.cnblogs.com/bamboo-zhang/p/9461547.html
Copyright © 2011-2022 走看看