In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
Today, I will talk to you about the production and release of the component Nuget package based on .net Core, which may not be well understood by many people. in order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.
Microsoft ASP.Net Core strengthens the use of Nuget, and all .net Core components are managed by Nuget, so it is necessary to explore the production and release of Nuget packages with .net Core components.
Previously, .net Framework assemblies packaged Nuget in the following ways:
1. For more information on using the command nuget pack, see a blog post in the blog Park entitled "creating Nuget packages with Command Line tools"
two。 Use NuGet Package Explorer
3. Vs plug-in NuBuild Project System.
The third method is the best. You can directly make the Nuget package in vs, and then use method 2 to verify whether the generated Nuget package is correct or fine-tuned, or you can use the nuget command to push the package.
The following is the packaging of .net Core components
Since Microsoft has Nuget to manage all .net Core components, it will certainly come up with a packaging tool or command, so let's start with the dotnet pack command.
You must have used dotnet-related commands before, so today let's talk about its packaging command dotnet pack. The packaging here is packed into nuget packages.
Package generation
Execute the command dotnet pack-- help to see what the parameters are.
-h needless to say, just check the help.
-o specify the directory to which the generated nuget package is to be output
-- do not compile the project when no-build is packaged
-b temporary input directory for the project at compile time
-c configure whether to use Debug mode or Release mode (default is Debug)
-version-suffix if the project version in project.json ends with *, this parameter can be specified to replace *
-s specifies whether it is for internal nuget use only.
Here is a simple example:
1. Execute the command under the project.json file directory: dotnet pack-c Release-o Nugets
two。 Execute the command in a directory other than project.json files:
Dotnet pack-c Release-o Nugets src\ Wlitsoft.Framework.Common.Abstractions\ project.json
After packaging, two files are generated.
Wlitsoft.Framework.Common.Abstractions.0.1.1-Beta.nupkg
Wlitsoft.Framework.Common.Abstractions.0.1.1-Beta.symbols.nupkg
The first file is the Nuget package file, and the second is the Nuget package file that includes the source code.
The naming rule is: project folder name + version number (version specified in project.json). It is not clear how to modify the default naming generation rule.
Note: the version number suffix-xxx marks the pre-release version.
Package inspection
The package has been generated successfully, then we use NuGet Package Explorer to open to see if the generated is correct, of course, you can also use compressed file software to open the nupkg file to view the description file of the nuget package.
Package upload
If it is an open source project, the package can be uploaded to the official Nuget server, and if it is an internal private project, it can be uploaded to an internal private Nuget server or file sharing server (Nuget source supports file sharing source).
1. Upload it on Nuget's official website.
two。 Upload using the Nuget command
This method needs to submit and generate a key, and then use the command to push the package to the Nuget server.
Verify the upload result
Open vs's Nuget query to see if there are any uploaded packages.
After reading the above, do you have any further understanding of the production and distribution of component Nuget packages based on .net Core? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.