我們將.Net Core 1.0項目升級到.Net Core 1.1,並意識到我們不能再在EF Core中搭建數據庫。下面是project.json文件:數據庫腳手架在.Net Core 1.1中停止工作
{
"version": "1.0.0-*",
"buildOptions": {
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.EntityFrameworkCore.Design": "1.1.0",
"Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
"Microsoft.EntityFrameworkCore.SqlServer.Design": "1.1.0",
"Microsoft.EntityFrameworkCore.Tools": "1.1.0-preview4-final",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.1.0"
}
},
"tools": {
"Microsoft.EntityFrameworkCore.Tools": "1.1.0-preview4-final",
"Microsoft.EntityFrameworkCore.Tools.DotNet": "1.1.0-preview4-final",
"Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.1.0-preview4-final"
},
"frameworks": {
"netcoreapp1.1": {
"imports": "dnxcore50"
}
}
}
當下面的命令在PM控制檯運行時,會產生下面的錯誤消息:無法識別的選項「--build鹼基路徑」
Scaffold-DbContext "Server=(localdb)\ProjectsV13;Database=MyDatabase;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models
使用谷歌搜索並不確定。任何解決方法或解決方法?
@Sanket爲什麼?這個解決方案背後的優點是什麼? – Arash