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>
<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.jpg</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>
</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
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!
页:
[1]