No 'Configuration' method was found in class 'WebApp.Startup
2024-09-05 17:42:13
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);
}
}
}
最新文章
- [Objective-C]关联(objc_setAssociatedObject、objc_getAssociatedObject、objc_removeAssociatedObjects)
- 腾讯bugly团队提供的android国内镜像
- eclipse+adt+sdk开发环境搭配
- 1到n数组,和为指定数所有序列问题
- 分享3一个博客HTML5模板
- Strategic Game HDU
- linux下ffmpeg安装
- 你不知道的JavaScript--Item13 理解 prototype, getPrototypeOf 和__proto__
- Kafka: Exactly-once Semantics
- 51Nod 1001 数组中和等于K的数对
- Linux将某目录授权给某组里的某用户
- Java编程的逻辑 (28) - 剖析包装类 (下)
- MVC4是不是类似于html页+ashx页之间用JSON通过AJAX交换数据这种方式、?
- 检测ASP.NET是否是调试模式
- flask报错No module named 'flask.ext'
- css 页面定位position
- 利用media query写响应式布局
- chrome不支持字体12px
- JS,JQUERY 常用笔记
- C# Ftp方式下载文件(无用户认证方式,支持断点续传)