You should copy the line starting with "WebSecurity.InitializeDatabaseConnection(...)" in InitializeSimpleMembershipAttribute.cs to the beginning of Application_Start method in Global.asaxprotected void Application_Start(){ WebSecurity.InitializeDatabaseConnection("MyDBContext", "UserProfile", "UserId", "UserName", autoCreateTables: true); AreaRegistration.RegisterAllAreas(); WebApiConfig.Register(GlobalConfiguration.Configuration); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); AuthConfig.RegisterAuth(); } 这篇关于SimpleMembership需要App_Data文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-12 09:07