NuGet:使用 .NET Framework 而不是 net5.0 恢复了包

NuGet: Package was restored using .NET Framework instead of net5.0

我是 .NET core 和 NuGet 发布的新手。

"包 SkyBridge.ClientAPI.NetCore 1.0.0.3 已使用 .NETFramework,版本=v4.6.1, .NETFramework,版本=v4.6.2, .NETFramework,版本=v4.7, .NETFramework,版本=v4.7.1, .NETFramework,版本=v4.7.2, .NETFramework,版本=v4.8 而不是项目目标框架net5.0。 此包可能与您的项目不完全兼容。"

这是 nuspec 文件:

<?xml version="1.0" encoding="utf-8"?>
<package >
  <metadata>
    <id>SkyBridge.ClientAPI.NetCore</id>
    <version>1.0.0.3</version>
    <title>SkyBridge.ClientAPI (.NET Core)</title>
    <authors>Front Edge Software, Frank Lieu</authors>
    <owners>Front Edge Software, Frank Lieu</owners>
    <requireLicenseAcceptance>true</requireLicenseAcceptance>
    <license type="file">SkyBridge_Client_API_Software_License_Agreement.txt</license>
    <licenseUrl>https://aka.ms/deprecateLicenseUrl</licenseUrl>
    <description>A class library used to act as a SkyBridge client and communicate with another SkyBridge client.</description>
    <summary>A class library used to act as a SkyBridge client and communicate with another SkyBridge client.</summary>
    <releaseNotes>Initial release.</releaseNotes>
    <copyright>Copyright ©2021 Front Edge Software</copyright>
    <tags>Front Edge SkyBridge Client API Remoting</tags>
    
    <dependencies>
        <dependency id="Crc32.NET" version="1.2.0" />
        <dependency id="BouncyCastle.NetCore" version="1.8.10" />
        <dependency id="BouncyCastle.NetCoreSdk" version="1.9.3.1" />
        <dependency id="System.Configuration.ConfigurationManager" version="6.0.0" />
    </dependencies>
  </metadata>
  <files>
    <file src="SkyBridge_Client_API_Software_License_Agreement.txt" target="" />
  </files>
</package>

有什么问题?

以下 nuspec 解决了问题 - 我指定了 .NET 依赖项:

<?xml version="1.0" encoding="utf-8"?>
<package >
  <metadata>
    <id>SkyBridgeAPI.NetCore</id>
    <version>1.0.0.6</version>
    <title>SkyBridgeAPI (.NET Core)</title>
    <authors>Front Edge Software, Frank Lieu</authors>
    <owners>Front Edge Software, Frank Lieu</owners>
    <requireLicenseAcceptance>true</requireLicenseAcceptance>
    <license type="file">SkyBridgeAPI_Software_License_Agreement.txt</license>
    <licenseUrl>https://aka.ms/deprecateLicenseUrl</licenseUrl>
    <description>A class library used to act as a SkyBridge client and communicate with another SkyBridge client.</description>
    <summary>A class library used to act as a SkyBridge client and communicate with another SkyBridge client.</summary>
    <releaseNotes>Initial release.</releaseNotes>
    <copyright>Copyright ©2021 Front Edge Software</copyright>
    <tags>Front Edge SkyBridge API Remoting</tags>
        
    
    <dependencies>
      <group targetFramework="net5.0">
        <dependency id="Crc32.NET" version="1.2.0" />
        <dependency id="BouncyCastle.NetCore" version="1.8.10" />
        <dependency id="BouncyCastle.NetCoreSdk" version="1.9.3.1" />
        <dependency id="System.Configuration.ConfigurationManager" version="6.0.0" />
      </group>
    </dependencies>
    
  </metadata>
  <files>
    <file src="SkyBridgeAPI_Software_License_Agreement.txt" target="" />
    <file src="lib\net5.0\FrontEdge.SkyBridgeAPI.dll" target="lib\net5.0" />
  </files>
</package>