Use NuGet our ASP.NET Core library package and the package (library) published on the NuGet management platform

This chapter and the next you briefly how to use NuGet share our ASP.NET Core library package and the package (libraries) to be released on NuGet management platform.

First, register and log in NuGet platform

NuGet official website: HTTPS: // www.nuget.org/

 Here I am using a Microsoft account to associate Login

 Login after successfully manage personal information, and not do too much here described

 Second, download nuget.exe file ASP.NET Core library package

 After the download is completed as follows:

 Then modified version of the library and other related information, click and select Properties right library package , as shown below:

 After editing remember to save and regenerate

Then open the Run as Administrator cmd, enter the directory where the file nuget.exe (nuget to execute commands) , such as my position is F: \ NuGetPublish

Command: cd / d F: \ NuGetPublish

 Then execute the command to package NuGet

Command: nuget pack path to the project file (.csproj project file to contain precise) 
For example: nuget pack F: \ TianYaDotNetCore \ TianYa.DotNetCore.Solution \ TianYaSharpCore.ComponentModel \ TianYaSharpCore.ComponentModel.csproj

 At this time we can see is successfully created, but the files created are not under our project file directory, but in the nuget.exe file corresponding to the directory, which is F: \ directory under NuGetPublish

 

 We can see this directory, generated a .nupkg type of package files

 Third, the package (library) published on the platform NuGet

方式1:直接上传刚才生成的.nupkg类型的程序包文件

 上传成功后直接点击提交即可,当然你也可以完善相关信息后再提交。

 最后稍微等待几分钟,就可以在NuGet平台上,管理包的地方看到刚刚发布那个包的相关信息了。

 当所发布包的状态为Published的时候,就可以在VS管理NuGet程序包中找到了,如下所示:

 至此,本章就介绍完了,如果你觉得这篇文章对你有所帮助请记得点赞关注哦,谢谢!!!

 

参考博文:https://www.cnblogs.com/fei686868/p/12120579.html

版权声明:如有雷同纯属巧合,如有侵权请及时联系本人修改,谢谢!!!

Guess you like

Origin www.cnblogs.com/xyh9039/p/12150131.html