diancheng001 于 2013.06.05 16:54 提问
- Code First 数据库迁移错误 类型"Configuration"不是迁移配置类型
-
在使用Code First 是碰到 * 类型"Configuration"不是迁移配置类型 * 的错误。
过程是这样的:
PM> enable-migrations
No context type was found in the assembly 'BlogSolution'.
PM> enable-migrations -ContextTypeName "BlogSolution.Models.BlogConnection" -verbose -force
Using StartUp project 'BlogSolution'.
Using NuGet project 'BlogSolution'.
正在检查上下文的目标是否为现有数据库...
类型“Configuration”不是迁移配置类型。
PM> update-database -verbose -force
Using StartUp project 'BlogSolution'.
Using NuGet project 'BlogSolution'.
指定“-Verbose”标记以查看应用于目标数据库的 SQL 语句。
在程序集“BlogSolution”中未找到任何迁移配置类型。(在 Visual Studio 中,您可从程序包管理器控制台使用 Enable-Migrations 命令添加迁移配置。)请帮忙看一下为什么会出现这种问题??
-
- heifengwll 2013.12.30 17:34
- 已采纳
enable-migrations -ContextTypeName "EFDbContext" -ProjectName "Domain" -StartUpProjectName "WebUI" -ConnectionStringName "ApplicationServices"
开启迁移, EFDbContext 在Domain类库项目里 共同学习420660467
-
-
lzp_lrp
2015.05.30 23:33