双城生活下载,colorcorrect.dlm,张宇辰
最近编译类库项目的时候发现总是有个 licenseurl 的警告,警告信息如下:
warning nu5125: the 'licenseurl' element will be deprecated. consider using the 'license' element instead
本文针对的是使用新版项目文件打包的方式,*.nuspec 官方文档详细,在此不多说。
新版的官方文档里基本没有提及,不过 github 有个 samples 项目,可以参考。
新版项目文件的 nuget 包原来可以指定一个 packagelicenseurl
来指定这个包的 license, 现在不再支持了,现在有两种方式可以指定,一种是 licenseexpression
一种是 licensefile
。
示例:
<project sdk="microsoft.net.sdk"> <propertygroup> <targetframework>netstandard2.0</targetframework> <packagelicenseexpression>mit</packagelicenseexpression> <!-- <packagelicenseexpression>apache-2.0</packagelicenseexpression> --> </propertygroup> </project>
更多license列表可以参考:
增加 license file,具体的 license 写在 license file 内,并配置打包,然后配置 packagelicensefile
<project sdk="microsoft.net.sdk"> <propertygroup> <targetframeworks>netstandard2.0</targetframeworks> <packagelicensefile>license.txt</packagelicensefile> </propertygroup> <itemgroup> <none include="license.txt" pack="true" visible="false" packagepath=""/> </itemgroup> </project>
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Net Core Web Api项目与在NginX下发布的方法
asp.net core3.1 引用的元包dll版本兼容性问题解决方案
IdentityServer4实现.Net Core API接口权限认证(快速入门)
ASP.NET Core MVC通过IViewLocationExpander扩展视图搜索路径的实现
网友评论