小编use*_*729的帖子

尚未启用角色管理器功能.MVC 4

我在包管理器控制台中更新数据库时出现错误,这是我的配置类和Web配置尚未启用角色管理器功能.请帮我

我的配置类

 namespace TechFactorsLMSV2.Migrations
 {
 using System;
 using System.Data.Entity;
 using System.Data.Entity.Migrations;
 using System.Linq;
 using System.Web.Security;
 using TechFactorsLMSV2.Models;
 using WebMatrix.WebData;

internal sealed class Configuration : DbMigrationsConfiguration<TechFactorsLMSV2.Models.LMSDBContext>
{
    public Configuration()
    {
        AutomaticMigrationsEnabled = false;
    }

    protected override void Seed(TechFactorsLMSV2.Models.LMSDBContext context)
    {
        context.Schools.AddOrUpdate(d => d.SchoolName,
               new School() { SchoolName = "School 1" },
               new School() { SchoolName = "School 2" },
               new School() { SchoolName = "School 3" }
               );

        SeedMembership();
    }

    private void SeedMembership()
    {
        WebSecurity.InitializeDatabaseConnection("DefaultConnection",
            "UserProfile", "UserId", "UserName", autoCreateTables: true);
        var …
Run Code Online (Sandbox Code Playgroud)

asp.net-mvc-4

7
推荐指数
1
解决办法
2万
查看次数

标签 统计

asp.net-mvc-4 ×1