简体   繁体   English

Myget 服务器将 Nuget 包许可证显示为 UnKnown

[英]Myget server show Nuget package license as UnKnown

I followed the instructions of nuget license here .我按照此处的 nuget 许可证说明进行操作。

I use the following code in myproject.csproj:我在 myproject.csproj 中使用以下代码:

 <PropertyGroup>
    <PackageLicenseFile>LICENSE.md</PackageLicenseFile>
  </PropertyGroup>

  <ItemGroup>
    <None Include="..\LICENSE.md" Pack="true" PackagePath=""/>
  </ItemGroup>

The Nuget package is built correctly. Nuget 包构建正确。
No build error or warning related to license.没有与许可证相关的构建错误或警告。 The license file is included in the package correctly.许可证文件正确包含在包中。

When I Inspect the nuspec file in the package, I find this xml code:当我检查包中的 nuspec 文件时,我发现了这个 xml 代码:

    <license type="file">LICENSE.md</license>
    <licenseUrl>https://aka.ms/deprecateLicenseUrl</licenseUrl>

In MyGet feed package, it show package license as UnKnown and point to: ' https://aka.ms/deprecateLicenseUrl '.在 MyGet 提要包中,它将包许可证显示为UnKnown并指向:“ https://aka.ms/deprecateLicenseUrl ”。

My Question:我的问题:

Why the nuspec file included in the package show deprecateLicenseUrl ?为什么包中包含的 nuspec 文件显示deprecateLicenseUrl

What I missed to show license in MyGet correctly?我错过了在 MyGet 中正确显示许可证的内容?

Why the nuspec file included in the package show deprecateLicenseUrl?为什么包中包含的 nuspec 文件显示 deprecateLicenseUrl?

Embedded licenses were added to the NuGet client in NuGet 4.9, which corresponds to Visual Studio 2017 15.9, around November 2018. Before then, only license URLs were supported.嵌入式许可证在 NuGet 4.9 中添加到 NuGet 客户端,对应于 Visual Studio 2017 15.9,大约在 2018 年 11 月。在此之前,仅支持许可证 URL。 This means that Visual Studio 2017 15.8 and earlier, as well as Visual Studio 2015 and earlier do not support embedded licenses, and so the license URL pointing to the documentation is added so that they show something, allowing customers to understand why they can't see the real license and instructions on how to find the actual license for the package.这意味着 Visual Studio 2017 15.8 及更早版本以及 Visual Studio 2015 及更早版本不支持嵌入式许可证,因此添加了指向文档的许可证 URL,以便它们显示某些内容,让客户了解为什么他们不能查看真正的许可证和如何找到包的实际许可证的说明。 Similarly, it means that NuGet feeds need to change to support embedded licenes.同样,这意味着需要更改 NuGet 提要以支持嵌入式许可证。 The NuGet client team worked with the nuget.org team to make sure they both supported it at the same time, but the NuGet team has no direct influence of other NuGet feed implementations. NuGet 客户端团队与 nuget.org 团队合作以确保他们同时支持它,但 NuGet 团队对其他 NuGet 源实现没有直接影响。 If MyGet has not updated to support embedded licenses, it can use the lincense url backwards compatibility aimed at users of old versions of Visual Studio.如果 MyGet 尚未更新以支持嵌入式许可证,它可以使用针对旧版 Visual Studio 用户的 lincense url 向后兼容性。

What I missed to show license in MyGet correctly?我错过了在 MyGet 中正确显示许可证的内容?

You could use both embedded license and a custom license URL, but then NuGet will generate warnings when you pack, and your package may be rejected if you try to pubilsh to nuget.org.您可以同时使用嵌入式许可证和自定义许可证 URL,但 NuGet 会在您打包时生成警告,如果您尝试发布到 nuget.org,您的包可能会被拒绝。 Otherwise you haven't missed anything, it just sounds like MyGet hasn't "kept up" with changes to NuGet.否则你不会错过任何东西,只是听起来 MyGet 没有“跟上”NuGet 的变化。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM