NuGet包与框架不兼容(Nuget package not compatible with fra

2019-09-28 04:07发布

我创造了我自己的NuGet包包含以下内容:

我有一个默认nuspec吧:

<?xml version="1.0"?>
<package >
  <metadata>
    <id>Communited.PluginService.Base</id>
    <version>5.4.3.4</version>
    <authors>Communited</authors>
    <owners>Communited</owners>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>The Communited PluginService Base application. Needed to run custom plugins</description>
    <copyright>Copyright 2016</copyright>
  </metadata>
</package>

当在我的项目安装此我得到以下错误:

Install-Package : Could not install package 'Communited.PluginService.Base 5.4.3.4'. You are trying to install this package into a project that targets 
'.NETFramework,Version=v4.5', 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.

那我在安装它的项目,是.NET框架4.5

我究竟做错了什么?

蒂姆

Answer 1:

你可以试试这个,去查看 - >其他窗口 - >程序包管理器控制台,

下面的命令运行,(所提供的包可用于目标框架)

update-package -reinstall

这里的更多信息, 更新包



文章来源: Nuget package not compatible with framework