Nuget Server - Private Repository - Change Package location Dynamically

93 views
Skip to first unread message

nagaraj marichamy

unread,
Feb 12, 2015, 9:22:24 AM2/12/15
to nuget-e...@googlegroups.com

We are working in private repository for our own private nuget packages in ASP.NET project. 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.

Is there a possibility to change the package folder location dynamically through routing(URL) ? i have refferd this blog http://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>

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?

Maarten Balliauw

unread,
Feb 13, 2015, 2:31:27 AM2/13/15
to nuget-e...@googlegroups.com
While probably possible to change the path depending on an incoming route value, I would personally look into another hosting solution. The NuGet.Server package tends to get very slow when there are a number of packages in there as it has no index of the package.

A little bit biased as the founder of MyGet, you could look at www.myget.org. Other alternatives are ProGet (www.inedo.com/proget) and there are several others listed at http://docs.nuget.org/Contribute/Ecosystem
Reply all
Reply to author
Forward
0 new messages