1
votes

I'm creating a NuGet package for my company and want to publish it to our local Apache server. I would like to add the folder location on the server to the NuGet.config file. I have read this article on hosting your own NuGet feeds. In this article, they reference another article talking about local feeds. From this article, I gathered that I will most likely need to create a local feed on the server.

Will I need to run this command on the Apache server itself? Does this command create the local feed on the server?

nuget init \packagesToHost \\myserver\packages

where myserver would be the IP address of the server.

1

1 Answers

1
votes

A local feed means local to the machine, something that can be opened with the operating system's "open file" API, so the file must be either on disk or on a network share. If the NuGet client needs to download packages from HTTP, it's not local. Therefore the nuget init command won't work unless you use network file sharing on myserver, in which case the fact that it also runs a HTTP server is irrelevant. Something to keep in mind is that it's not very efficient for browsing and searching, so if your feed has lots of packages, people using Visual Studio's Package Manager UI will have a bad experience.

If you want to use a HTTP feed, you need to investigate one of the apps listed on the page you linked. You could look into Sleet, as it generates static files that any HTTP server can host, like Apache, without knowing anything about NuGet. All the other HTTP servers are applications that need to be hosted appropriately.