Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build a private NuGet server-BaGet

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

How to build a private NuGet server-BaGet, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.

Preface

NuGet is the package manager for the Microsoft .NET (including .NET Core) development platform. NuGet makes it faster and easier for you to add, remove, and update references in your project.

NuGet is usually an official service, but have you ever thought about building your own NuGet? Host some of your own class libraries, internal class libraries, etc., on a private NuGet. There are many ways to build a private NuGet, such as NuGet.Server, ProGet, MyGet, and so on. The following is the use of BaGet, the building process is also very simple, let's get to the point.

Start building BaGet

BaGet is an open source implementation of NuGet V3 server built on ASP.NET Core.

Github address: https://github.com/loic-sharma/BaGet

Download the release package, I downloaded the latest preview version, you can also choose other versions:

Https://github.com/loic-sharma/BaGet/releases/download/v0.3.0-preview4/BaGet.zip

You can modify the port configuration as needed. The default is 5000:

Open the command line in the unzipped directory and execute: dotnet BaGet.dll

Browser access: http://localhost:8020/

In this way, the NuGet service is built, isn't it easy?

Upload package

Casually create a class library project for testing:

Right-click the project and select package:

When you finish packaging, you will get a nupkg file:

Of course, you can also choose Release mode:

Take a look at the Upload command:

Open the command line under the above package directory to execute: dotnet nuget push-s http://localhost:8020/v3/index.json MyTestLibrary.1.0.0.nupkg

Check the Packages again:

Use in vs

Open in vs2019: tools-options-NuGet package Manager-package Source. Add a source, enter a name, source: http://localhost:8020/v3/index.json

Then you can use it normally:

Other

The author, description, version number and other information of the package can be modified here:

Dependencies don't have to worry at all:

Because BaGet is based on ASP.NET Core development, it is inherently cross-platform and can be easily deployed in windows,mac,linux or docker. In addition, BaGet does not have complex environment dependencies, and the database default Sqlite, which is lightweight and easy to deploy.

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, 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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report