Asp.net mvc 4 实体框架包迁移问题

Asp.net mvc 4 实体框架包迁移问题,asp.net-mvc-4,entity-framework-migrations,Asp.net Mvc 4,Entity Framework Migrations,我正在尝试为我的MVC应用程序迁移一个实体。我在这方面完全是新手,对.NETMVC知之甚少。我遇到的问题是,当我运行迁移时,会出现错误“关键字不受支持:'userid'”。我不知道他指的是什么“用户ID”。有人能告诉我迁移是如何工作的,这样我就可以知道它在错误中指的是什么“userid”吗 多谢各位 启用迁移-ContextTypeName BBGDB检查上下文 以现有数据库为目标。。。System.ArgumentException:关键字不是 支持:“userid”。在 System.Dat

我正在尝试为我的MVC应用程序迁移一个实体。我在这方面完全是新手,对.NETMVC知之甚少。我遇到的问题是,当我运行迁移时,会出现错误“关键字不受支持:'userid'”。我不知道他指的是什么“用户ID”。有人能告诉我迁移是如何工作的,这样我就可以知道它在错误中指的是什么“userid”吗

多谢各位

启用迁移-ContextTypeName BBGDB检查上下文 以现有数据库为目标。。。System.ArgumentException:关键字不是 支持:“userid”。在 System.Data.Common.DbConnectionOptions.ParseInternal(哈希表 解析表,字符串连接字符串,布尔构建链,哈希表 同义词,布尔值(firstKey) System.Data.Common.DbConnectionOptions..ctor(字符串连接字符串, 哈希表同义词,布尔值useOdbcRules)位于 System.Data.SqlClient.SqlConnectionString..ctor(字符串 连接字符串)在 System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(字符串 连接字符串,数据库连接选项(上一个)位于 System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(DbConnectionPoolKey 键,DbConnectionPoolGroupOptions池选项,DbConnectionOptions& 用户连接选项)位于 System.Data.SqlClient.SqlConnection.ConnectionString_集(DbConnectionPoolKey 键)在 System.Data.SqlClient.SqlConnection.set\u ConnectionString(字符串值) 在 System.Data.Entity.Internal.LazyInternalConnection.InitializeFromConnectionString设置(ConnectionString设置 appConfigConnection)位于 System.Data.Entity.Internal.LazyInternalConnection.TryInitializeFromAppConfig(字符串 名称,AppConfig)位于 System.Data.Entity.Internal.LazyInternalConnection.Initialize()位于 System.Data.Entity.Internal.LazyInternalConnection.get_Connection()
位于System.Data.Entity.Internal.LazyInternalContext.get_Connection()
位于System.Data.Entity.Infrastructure.DbContextInfo..ctor(类型 contextType、DbProviderInfo模型ProviderInfo、AppConfig配置、, DbConnectionInfo(连接信息)位于 System.Data.Entity.Infrastructure.DbContextInfo..ctor(类型 上下文类型)在 System.Data.Entity.Migrations.Dbmigator..ctor(Dbmigrations配置 配置,DbContext usersContext)位于 System.Data.Entity.Migrations.Dbmigator..ctor(Dbmigrations配置 配置)在 System.Data.Entity.Migrations.Design.MigrationScaffolder..ctor(DbMigrationsConfiguration 迁移配置)位于 System.Data.Entity.Migrations.Design.ToolingFacade.ScaffoldRunner.RunCore() 位于System.Data.Entity.Migrations.Design.ToolingFacade.BaseRunner.Run()处 不支持关键字:“userid”


听起来像是指默认连接字符串中的用户ID。检查您的连接字符串并将userid替换为user id。

顺便说一句,我的表中没有“userid”列,但我有“userid”。但即使我删除了现有的表,它仍然显示相同的错误。它在哪里?有人能帮帮我吗?!哇!非常感谢你解决了这个问题。现在我想知道我的连接字符串是“userid”而不是“userid”。我一定是因为学习了.NETMVC而昏昏欲睡。谢谢Wiktor Zychla!