我跟着ASP.NET Core - New Database使用EF在Asp.net核心VS 2015下,但在安装包后得到了下面的错误。Asp.net核心EF在2015年VS
启动项目“的src \ CoreMVCWebAPI”是一个ASP.NET核心或.NET核心 项目为Visual Studio 2015这个版本的实体框架 Core软件包管理器控制台工具不支持这些类型的 项目。
在该文件中,它说,它需要VS 2017年RC,我想知道它是否是2015年VS下提供,或者是有,我可以在Asp.net核心,或Ado.net使用EF任何解决方法从SQL数据库中检索数据。
PM> Add-Migration MyFirstMigration
Invalid object passed in, ':' or '}' expected. (339): {
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.1",
"type": "platform"
},
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
"Microsoft.Extensions.Logging.Console": "1.0.0",
//Dependence for MVC
"Microsoft.AspNetCore.Mvc": "1.1.1",
"Microsoft.AspNetCore.StaticFiles": "1.1.0",
"Microsoft.Extensions.Configuration.FileExtensions": "1.1.0",
"Microsoft.Extensions.Configuration.Json": "1.1.0",
//Dependence for EF
"Microsoft.EntityFrameworkCore":"1.1.0",
"Microsoft.EntityFrameworkCore.InMemory": "1.1.0",
"Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
"Microsoft.EntityFrameworkCore.Tools":"1.1.0-preview4-final"
//Dependence for EF with SQL, this is avalible under VS 2017 RC
//"Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
//Entity Framework commands to maintain the database
//"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview4-final"
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
},
"buildOptions": {
"emitEntryPoint": true,
//used for Razor pages which are compiled at runtime,and the compiler needs access to reference assemblies,
//to make sure it compiles correctly
"preserveCompilationContext": true
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},
"publishOptions": {
"include": [
"wwwroot",
"web.config"
]
},
"scripts": {
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
源代码:https://github.com/Edward-Zhou/DotNetCore
你使用哪个工具版本?目前的变化与2017年VS改变项目格式发生,所以最新的工具版本(版本高于preview2)不会VS 2015 – poke
使用此[链接](https://docs.microsoft.com/en工作-us/ASPNET /核心/数据/ EF-MVC /介绍)。这说明了如何使用实体框架的核心1.0和Visual Studio 2015年 – Sanket