我需要帮助在.net framework 4.8上安装EFCore 3.0 [英] I need help installing EFCore 3.0 on .net framework 4.8

查看:58
本文介绍了我需要帮助在.net framework 4.8上安装EFCore 3.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我想通过NetFramework 4.8项目上的NuGet将EFCore参考更新到版本3时,都会出现此错误.

我确认我的计算机上已安装netcore 3.0 SDK.

 无法安装包'Microsoft.EntityFrameworkCore 3.0.0'.您正在尝试将此软件包安装到以'.NETFramework,Version = v4.8'为目标的项目中,但是该软件包不包含任何与该框架兼容的程序集引用或内容文件.有关更多信息,请与软件包作者联系. 

解决方案

这是EF Core 3.0中的一项重大突破.但是已在EF Core 3.1中修复.

从3.0开始,EF Core面向.NET Standard 2.1,并将在以下版本上运行支持该标准的所有平台.这不包括.NET框架.

目标.NET Standard 2.1

并且没有计划将来的.NET Framework版本支持.NET Standard 2.1.参见例如:

鉴于.NET Standard 2.1中的许多API附加要求运行时为了使更改有意义,.NET Framework 4.8将保留在.NET Standard 2.0,而不是实现.NET Standard 2.1..NET核心3.0以及即将发布的Xamarin,Mono和Unity版本将进行更新,以实现.NET Standard 2.1.

宣布.NET Standard 2.1 ..>

因此,您必须跳至EF Core 3.1和至少.NET Framework.4.7.2.

[更新]

EF Core 3.1重新引入了对.NET Standard 2.0的支持,而不是要求.NET Standard 2.1,就像EF Core 3.0一样.这表示EF Core 3.1将在支持以下功能的.NET Framework版本上运行:标准.

.NET Framework 4.7.2和更高版本完全支持.NET Standard 2.0,因此EF Core 3.1也是如此.有关支持列表,请参见此处. https://devblogs.microsoft.com/dotnet/announcing-entity-framework-core-3-1-and-entity-framework-6-4/

Whenever I want to update my EFCore reference to version 3 via NuGet on my NetFramework 4.8 project I get this error.

I confirm that I have netcore 3.0 SDK installed on my machine.

Could not install package 'Microsoft.EntityFrameworkCore 3.0.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.8', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.              

解决方案

This is a major breaking change in EF Core 3.0. But was fixed in EF Core 3.1.

Starting with 3.0, EF Core targets .NET Standard 2.1 and will run on all platforms that support this standard. This does not include .NET Framework.

Breaking changes included in EF Core 3.0

And here is the tracking issue with lots of background on this change: Target .NET Standard 2.1

And no future version of .NET Framework is planned to support .NET Standard 2.1. See eg:

Given many of the API additions in .NET Standard 2.1 require runtime changes in order to be meaningful, .NET Framework 4.8 will remain on .NET Standard 2.0 rather than implement .NET Standard 2.1. .NET Core 3.0 as well as upcoming versions of Xamarin, Mono, and Unity will be updated to implement .NET Standard 2.1.

Announcing .NET Standard 2.1.

So you must jump to EF Core 3.1 and at least .NET Framework. 4.7.2.

[UPDATE]

EF Core 3.1 reintroduces support for .NET Standard 2.0, rather than requiring .NET Standard 2.1 as was the case for EF Core 3.0. This means EF Core 3.1 will run on .NET Framework versions that support the standard.

And the .NET Framework 4.7.2 and higher fully support .NET Standard 2.0, and so EF Core 3.1 also. See here for the support matrix. https://devblogs.microsoft.com/dotnet/announcing-entity-framework-core-3-1-and-entity-framework-6-4/

这篇关于我需要帮助在.net framework 4.8上安装EFCore 3.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆