将NuGet软件包发布到本地Apache服务器

时间:2019-01-16 14:09:05

标签: nuget

我正在为我的公司创建一个NuGet软件包,并希望将其发布到我们的本地Apache服务器。我想将服务器上的文件夹位置添加到NuGet.config文件中。我已经阅读了this条有关托管自己的NuGet提要的文章。在本文中,他们引用了另一篇有关local feeds的文章。从本文中,我得出结论,很可能需要在服务器上创建本地供稿。

我需要在Apache服务器本身上运行此命令吗?该命令是否在服务器上创建本地供稿?

nuget init \packagesToHost \\myserver\packages

其中myserver将是服务器的IP地址。

1 个答案:

答案 0 :(得分:0)

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.