我使用这个命令:
dnx ef dbcontext scaffold "Server=webuat08,1433,Database=Store;user
id=user_here;password=password_here" EntityFramework.MicrosoftSqlServer数据库"Store“存在。但是我得到了以下错误:
Unable to identify the primary key for table 'dbo.spt_fallback_db'.
Unable to generate entity type for table 'dbo.spt_fallback_db'.
Unable to identify the primary key for table 'dbo.spt_fallback_dev'.
Unable to generate entity type for table 'dbo.spt_fallback_dev'.
Unable to identify the primary key for table 'dbo.spt_fallback_usg'.
Unable to generate entity type for table 'dbo.spt_fallback_usg'.
Could not find type mapping for column
'dbo.MSreplication_options.optname' with data type 'sysname'. Skipping column.
Unable to identify the primary key for table 'dbo.MSreplication_options'.
Unable to generate entity type for table 'dbo.MSreplication_options'.
Unable to identify the primary key for table 'dbo.spt_monitor'.
Unable to generate entity type for table 'dbo.spt_monitor'.
Done如果我在命令中将数据库的名称更改为一个不存在的DB,我仍然会得到相同的错误。有什么想法吗?
发布于 2016-09-15 07:56:23
您需要将主键放入表中
https://stackoverflow.com/questions/34616902
复制相似问题