nam*_*nam 31 c# entity-framework-core visual-studio-2015 asp.net-core
在我从同一教程创建的VS2015项目中运行该命令后,遵循此MicrosoftPM> Add-Migration MyFirstMigration
教程我得到以下错误,我无法解决:
More than one DbContext was found. Specify which one to use. Use the '-Context' parameter for PowerShell commands and the '--context' parameter for dotnet commands.
Run Code Online (Sandbox Code Playgroud)
要点注意
Individual User Account
身份验证而不是No Authentication
在教程中使用.ASP.NeT Core 1.0 and VS2015-Update 3 on windows 8.1
nam*_*nam 46
运行以下命令(从获得的这篇文章),并从@Maverik响应(从计算器这里),并从@doctor建议上面帮我解决了问题.感谢大家的帮助:
PM> Add-Migration MyFirstMigration -Context BloggingContext
Run Code Online (Sandbox Code Playgroud)
Die*_*cio 14
如果您只需要更新现有的身份架构,请尝试:
update-database -Context ApplicationDbContext
Run Code Online (Sandbox Code Playgroud)
ApplicationDbContext = 您的身份上下文
小智 9
如果有多个DbContext,错误清楚地解释了 - 带有db Context名称的--context.因此,请尝试提及您的DbContext名称.
dotnet ef migrations add Initial --context SampleDbContext
Run Code Online (Sandbox Code Playgroud)
希望这可以帮助.
归档时间: |
|
查看次数: |
36349 次 |
最近记录: |