gpt4 book ai didi

entity-framework - 此版本的 Entity Framework Core Package Manager Console Tools 不支持这些类型的项目

转载 作者:行者123 更新时间:2023-12-01 07:52:27 25 4
gpt4 key购买 nike

使用此 tutorial 将现有项目更新到 ASP.NET Core 1.1 和 Entity Framework Core 1.1 后
我试图在包管理控制台中执行“Add-Migration MigrationName”,但出现错误:

Startup project 'src\ProjectName' is an ASP.NET Core or .NET Core project for Visual Studio 2015. This version of the Entity Framework Core Package Manager Console Tools doesn't support these types of projects.



我正在使用 VS 2015 更新 3。
项目.json
{
"dependencies": {
"CoursesManagement.DAL": "1.0.0-*",
"Microsoft.AspNetCore.Diagnostics": "1.1.1",
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.1.1",
"Microsoft.AspNetCore.Mvc": "1.1.2",
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.1",
"Microsoft.AspNetCore.Server.Kestrel": "1.1.1",
"Microsoft.AspNetCore.StaticFiles": "1.1.1",
"Microsoft.Extensions.Configuration.FileExtensions": "1.1.1",
"Microsoft.Extensions.Configuration.Json": "1.1.1",
"Microsoft.Extensions.Logging.Console": "1.1.1",
"Microsoft.EntityFrameworkCore.SqlServer": "1.1.1",
"Microsoft.NETCore.App": "1.1.1",
"Microsoft.EntityFrameworkCore": "1.1.1",
"Microsoft.EntityFrameworkCore.Tools": {
"version": "1.1.0",
"type": "build"
},
"Microsoft.EntityFrameworkCore.Design": "1.1.1"
},

"tools": {
"Microsoft.EntityFrameworkCore.Tools": "1.1.0",
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final",
"Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final"
},

"frameworks": {
"netcoreapp1.1": {
"dependencies": {
},
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
},

"runtimes": {
"win10-x64": {}
},

"buildOptions": {
"emitEntryPoint": true,
"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%" ]
}
}

全局文件
{
"projects": [ "src" ],
"sdk": {
"version": "1.0.0-preview2-003131"
}
}

最佳答案

this 中所述博客,

We’re now encouraging everyone to migrate to MSBuild and csproj from project.json. As I stated above, we will not be supporting any of the new .NET Core tools in Visual Studio 2015. We also won’t be updating the Visual Studio 2015 project.json-based tools.



您正在使用 EFCore.Tools包版本 1.1.0不支持 project.json。 project.json 的工具从未达到 RTM。适用于 EF Core 1.1 包的预览版本是 EFCore.Tools 1.1.0-preview4-final .

同样如其他答案中所述,如果您想使用 powershell 命令,则需要安装 EFCore.Tools包但如果你想要 dotnet ef那么你需要安装 EFCore.Tools.DotNet (版本 1.1.0-preview3-final 因为 preview4-final 有小问题)。

如上所述,基于 project.json 的工具不会有任何更新。您仍然可以使用上面的预览包,但最好的选择是尽可能迁移到 VS2017 csproj。

关于entity-framework - 此版本的 Entity Framework Core Package Manager Console Tools 不支持这些类型的项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43068552/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com