问题描述
我们正在为自己的私有nuget包在私有存储库中工作。我们可以为每个客户更改nuget提要。但是nuget包位于Web.Config中指定的位置。
We are working in private repository for our own private nuget packages. We are in a position to change the nuget feed for every customer. But nuget packages are located in a location which is specified in Web.Config.
是否可以通过routing(URL)动态更改位置?
i推荐了此博客
,即使软件包的url指的是给定的路径在网络配置文件中
Is there a possibility to change the location dynamically through routing(URL) ?i have refferd this bloghttp://blog.maartenballiauw.be/post/2011/05/09/Using-dynamic-WCF-service-routes.aspx even though the packages url refers the path given in the webconfig file
public static void MapNugetRoutes(RouteCollection routes)
{
var factory = new DataServiceHostFactory();
var serviceRoute = new ServiceRoute("nuget/packages/getpackages/{platform}", factory, typeof(Packages));
serviceRoute.Defaults = new RouteValueDictionary { { "serviceType", "odata" } };
serviceRoute.Constraints = new RouteValueDictionary { { "serviceType", "odata" } };
routes.Add("nuget", serviceRoute);
}
<appSettings>
<add key="requireApiKey" value="true" />
<add key="apiKey" value="" />
<add key="packagesPath" value="~/NugetPackages/" />
<add key="enableSimpleMembership" value="false" />
<add key="" />
</appSettings>
NugetPackages是我的本地存储库地址,我需要私下访问存储库,就像有在上述位置中的几个文件夹中,我需要动态访问该文件夹,例如NugetPackages / folder1,NugetPackages / folder2,
有可能吗?
the "NugetPackages" is my local repositary address , i need to access the repositary privately , like there are several folders inside that above location, i need dynamically access that folders NugetPackages/folder1, NugetPackages/folder2 like this,Is it possible?
请先谢谢。
推荐答案
选项1:我已经通过为每个平台添加子应用程序并重定向到nugerepository解决了此问题。它现在可以正常工作
option 1 : i have solved this issue by adding sub application for each platform and redirect to the nugetrepositary. it works fine now
选项2:几年后,我发现。使用此服务器,您可以轻松管理多个NuGet提要。它还提供了支持所有功能的免费版本。
option 2 : after some years, i have found ProGet. using this server you can easily manage multiple NuGet feeds. it also provides free edition which supports all features.
这篇关于NuGet服务器-专用存储库-动态更改nuget包的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!