豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Misleading error when .NET Standard version is not known to be compatible with target framework  #5818

@divega

Description

@divega

On the first few days after we released .NET Standard 2.0 (and a wave of new packages that target it) we have seen several customer reports for this kind of error:

Could not install package ‘Microsoft.EntityFrameworkCore.SqlServer 2.0.0’. You are trying to install this package into a project that targets ‘.NETFramework,Version=v4.7’, 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.

We believe a significant number of customers are now seeing this error because they have older NuGet client or dotnet CLI bits that are not aware of .NET Standard 2.0 and its compatible TFMs.

For these customers, the recommendation in the error message is misleading and ideally we would be prompting them to upgrade NuGet client or dotnet CLI.

Presumably, this can still happen again in the future:

  • Whenever we ship a new version of .NET Standard
  • Whenever we ship a new version of a .NET platform that is supposed to be compatible with an existing version of .NET Standard

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area:ErrorHandlingwarnings and errors/log messages & related error codes.Type:Bug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions