<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!--项目支持的框架版本-->
<TargetFrameworks>
net35;
net40;
net45;
net451;
net452;
net46;
net461;
net462;
net47;
net471;
net472;
net48;
netstandard2.0;
netstandard2.1;
netcoreapp3.1;
net5.0;
net6.0;
</TargetFrameworks>
<!--包标识符-->
<PackageId>Aliang.Common.Helper</PackageId>
<!--包标题, 默认为 PackageId-->
<Title>Aliang.Common.Helper</Title>
<!--包输出路径-->
<PackageOutputPath>./nupkg</PackageOutputPath>
<!--设置Tag标签-->
<PackageTags>NET;Csharp;Helper;</PackageTags>
<!--以publish目标运行-->
<IsPublishable>False</IsPublishable>
<!--生成的时候是否生成NuGet包-->
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<!--作者,包创建者多个的逗号分隔列表-->
<Authors>码农阿亮</Authors>
<!--公司-->
<Company />
<!--包的详细描述信息-->
<Description>这是一个通用的帮助工具类库</Description>
<!--项目地址-->
<PackageProjectUrl>https://gitee.com/mingliang_it/Aliang.Common.Helper</PackageProjectUrl>
<!--包中要用作包图标的图像的路径-->
<PackageIcon>Aliang.png</PackageIcon>
<!--控制是否需要许可-->
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<!--版本设置-->
<AssemblyVersion>1.0.1</AssemblyVersion>
<FileVersion>1.0.1</FileVersion>
<Version>1.0.1</Version>
<Platforms>AnyCPU;x86;x64</Platforms>
<!--仓库地址-->
<RepositoryUrl>https://gitee.com/mingliang_it</RepositoryUrl>
<!--设置资源如果较新复制到目录-->
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<!--编译好后会同时生成一个xml的注释文件-->
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<!--包的自述文件-->
<PackageReadmeFile>ReadMe.md</PackageReadmeFile>
<!--版权信息-->
<Copyright>Copyright 2023 © 码农阿亮. All rights reserved.</Copyright>
</PropertyGroup>
<ItemGroup>
<!--引入的第三方Nuget包-->
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<!--设置NuGet图标,必须添加配置把图片资源打包-->
<None Include="Aliang.jpg" Pack="true" PackagePath="" />
<None Include="Aliang.png" Pack="true" PackagePath="" />
<!--包的自述文件引入-->
<None Include="ReadMe.md" Pack="true" PackagePath="" />
</ItemGroup>
</Project>
设置Key
nuget setApiKey [Your-API-Key] -Source https://www.nuget.org/api/v2/package/
打包
nuget pack Aliang.Common.Helper.csproj -Prop Configuration=Release
上传
nuget push Aliang.Common.Helper.1.0.1.nupkg -Source https://www.nuget.org/api/v2/package/
删除(搜索不显示)
nuget delete Aliang.Common.Helper 1.0.1 -Source https://www.nuget.org/api/v2/package/
<PropertyGroup>
<IsPackable>true</IsPackable>
</PropertyGroup>
nuget pack
dotnet pack