【发布时间】:2022-01-04 02:33:17
【问题描述】:
我正在远离 .NET Core/5/6 NuGet 包的 .nuspec 文件,但我不知道如何在 .csproj 文件中设置等效的 <requireLicenseAcceptance> 元素。
我在包中包含一个名为 license.txt 的许可证文件,例如:
<ItemGroup>
<None Include="license.txt">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>
然后我设置以下内容:
<PropertyGroup>
<PackageLicenseExpression></PackageLicenseExpression>
<PackageLicenseFile>license.txt</PackageLicenseFile>
</PropertyGroup>
这会在生成的.nuspec 文件中产生以下内容:
<license type="file">license.txt</license>
<licenseUrl>https://aka.ms/deprecateLicenseUrl</licenseUrl>
我希望<requireLicenseAcceptance>true</requireLicenseAcceptance>也包含在生成的.nuspec文件中,以便在安装包时弹出license.txt的内容。
【问题讨论】: