我正在为我的应用程序创建一个DAL层。 当我在我的网络应用程序中引用它时,它按预期工作。 甚至Scaffold-DbContext命令都能正常工作并生成必要的上下文。我使用以下是project.json:
{
"version": "1.0.0-*",
"buildOptions": {
"emitEntryPoint": false
},
"dependencies": {
"Microsoft.EntityFrameworkCore.SqlServer": "1.0.1",
"Microsoft.EntityFrameworkCore.SqlServer.Design": "1.0.1",
"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
} },
"tools": {
"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final"
},
"frameworks": {
"netcoreapp1.0": {
"imports": [ "portable-net45+win8+wp8+wpa81", "portable-net45+win8+wp8", "dnxcore50" ]
}
}
}
当我尝试将框架更改为&#34; netstandard1.6&#34;时,我无法从包管理器控制台运行Scaffold-DbContext命令,以下是更改的project.json:< / p>
{
"version": "1.0.0-*",
"buildOptions": {
"emitEntryPoint":false
},
"dependencies": {
"NETStandard.Library": "1.6.0",
"Microsoft.EntityFrameworkCore.SqlServer": "1.0.1",
"Microsoft.EntityFrameworkCore.SqlServer.Design": "1.0.1"
},
"tools": {
"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final"
},
"frameworks": {
"netstandard1.6": {
"imports": [ "portable-net45+win8+wp8+wpa81", "portable-net45+win8+wp8", "dnxcore50" ]
}
}
}
我的问题是,如果我的DAL dll的框架为netcoreapp1.0或netstandard1.6,这有关系吗?如果是这样,那么解决方案是使用netstandard1.6作为框架在proj上运行Scaffold-DbContext命令
答案 0 :(得分:0)
不,最后,不应该重要。但是,EF工具仍处于预发布状态,并且存在许多粗糙边缘。您发现问题#5320。将主应用程序作为-StartupProject
传递应解决此问题。