最近,当执行Add-Migration命令时,我收到了以下错误
Cannot execute this command because the version of Microsoft.EntityFrameworkCore.Design installed is not compatible with this tool.
我当前的project.json
{
"buildOptions": {
"emitEntryPoint": true
},
"frameworks": {
"netcoreapp1.0": {}
},
"dependencies": {
"Microsoft.AspNetCore.Identity": "1.0.0",
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0",
"Microsoft.NETCore.App": "1.0.1",
"Microsoft.EntityFrameworkCore.SqlServer": "1.0.1",
"System.Linq.Queryable": "4.0.1",
"System.Linq.Dynamic.Core": "1.0.6.8",
"OpenIddict": "1.0.0-*",
"Microsoft.EntityFrameworkCore.Design": {
"version": "1.0.0-preview2-final",
"type": "build"
}
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview3-final",
"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview3-final"
},
"runtimes": {
"win10-x64": {}
}
}
但我也试过版本
"Microsoft.EntityFrameworkCore.Design": "1.0.1"
dotnet restore和dotnet -ef命令都正在执行,没有任何问题。
谢谢, 康拉德
答案 0 :(得分:1)
感谢Tseng, 它在改为:
后开始工作 "tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview3-final",
"Microsoft.EntityFrameworkCore.Tools": {
"version": "1.0.0-preview2-final",
"imports": [
"portable-net45+win8+dnxcore50",
"portable-net45+win8"
]
}
},