NuGet常用基本配置和命令
常用基本配置项<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>
<Title>Aliang.Common.Helper</Title>
<PackageOutputPath>./nupkg</PackageOutputPath>
<PackageTags>NET;Csharp;Helper;</PackageTags>
<IsPublishable>False</IsPublishable>
<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>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<PackageReadmeFile>ReadMe.md</PackageReadmeFile>
<Copyright>Copyright 2023 © 码农阿亮. All rights reserved.</Copyright>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<None Include="Aliang.jpg" Pack="<PropertyGroup>
<IsPackable>true</IsPackable>
</PropertyGroup>" PackagePath="" />
<None Include="Aliang.png" Pack="<PropertyGroup>
<IsPackable>true</IsPackable>
</PropertyGroup>" PackagePath="" />
<None Include="ReadMe.md" Pack="<PropertyGroup>
<IsPackable>true</IsPackable>
</PropertyGroup>" PackagePath="" />
</ItemGroup>
</Project>基本命令
[*]设置Key
nuget setApiKey -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打包命令
nuget packdotnet打包命令
dotnet pack
来源:https://www.cnblogs.com/wml-it/archive/2023/08/28/17661490.html
免责声明:由于采集信息均来自互联网,如果侵犯了您的权益,请联系我们【E-Mail:cb@itdo.tech】 我们会及时删除侵权内容,谢谢合作!
页:
[1]