gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-05 03:32:34 25 4
gpt4 key购买 nike

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

  • 我构建了一个 .NET Core 5.0 类库。
  • 我构建了一个 .NET Core 5.0 控制台应用程序来测试这个类库
  • 如果测试控制台应用程序直接引用从该类库构建的 DLL,则一切正常。
  • 如果我使用类库构建 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>

关于.net-core - NuGet:使用 .NET Framework 而不是 net5.0 恢复了包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70446991/

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