Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I publish a private NuGet package?

I have an assembly that I have made which is very specific to my team at my company. I want to be able to use NuGet to make this assembly avaiable to other projects that my team and similar teams at my company are working on. However, the assembly isn't really code that I want to share with the world.

I know with Maven, you can create local repositories and source packages from a local repo. Does NuGet support similar functionality? Is there a way with NuGet to specify either a local repository or to have private packages?

like image 412
stevebot Avatar asked Jan 25 '13 17:01

stevebot


People also ask

How use NuGet private package?

Go to Tools > NuGet Package Manager > Package Manager Settings, select Package Manager Sources, and then click the + button. Choose feed Name, set the feed URL to: https://nuget.telerik.com/nuget, and click OK. Create or load your project. Go to Tools > NuGet Package Manager > Manage NuGet Packages for a solution.

How do I update a private NuGet package?

These settings are found under 'Tools' > 'NuGet Package Manager' > 'Package Manager Settings' > 'Package Sources'. Go back to the NuGet Package Manager via 'Tools' > 'NuGet Package Manager' > 'Manage Nuget Packages for Solution'. Filter the sources at the top right to include only packages from your private feed.

How do I setup a NuGet private server?

Go to Tools > Options and browse to NuGet Package Manager > Package Sources. Alternatively, right click on the project in the Solution Explorer, hit Manage NuGet Packages and then hit the gear icon next to the Package Source combo. Add your server to the list of available sources.

How do I create a private NuGet package in Visual Studio 2019?

You can configure Visual Studio to automatically generate the NuGet package when you build the project. In Solution Explorer, right-click the project and choose Properties. In the Package tab, select Generate NuGet package on build.


4 Answers

Yes! You can host your own NuGet server!

The easiest way is creating a shared folder on your server and referencing that as your Nuget Server.

You can find more information about how to do that at: Hosting Your Own NuGet Feeds

like image 63
Glauco Vinicius Avatar answered Oct 05 '22 17:10

Glauco Vinicius


Another option for hosting your own NuGet server is to use JetBrains TeamCity as a build server. The setup is described here.

The Team City server acts as a NuGet repository that would/could/should only be accessible within your company.

Based on your usage, there are free versions of the software.

It has some nice options such as the ability to publish a new NuGet version on demand, with each new continuous integration build, etc. One of the most useful bits (as with all NuGet server implementations) is that it will keep dozens of older versions of your assemblies so if you have one project that needs to reference the newest version, and another project that needs to reference an older version, everything will work out.

like image 43
Kevin Kalitowski Avatar answered Oct 05 '22 16:10

Kevin Kalitowski


Check out the ProGet free edition; we built it exactly for this purpose. It takes much less time to setup and offers many features above and beyond those offered by the standard NuGet server, such as multiple feeds, feed aggregation, and additional repository types (npm, Bower, etc.)

If you want to pay for the enterprise version, you also get the ability to use LDAP for authentication, and the ability to filter feeds by name/license from connected feeds (i.e. NuGet's official feed).

like image 38
Tod Hoven Avatar answered Oct 05 '22 15:10

Tod Hoven


Yes, you can have local feeds. It's dead-simple to set up, take a look here.

MyGet is popular for hosting private feeds. It's not free, but take a look at their pricing and maybe it suits you well!

like image 28
Jim Aho Avatar answered Oct 05 '22 17:10

Jim Aho