Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NuGet Server - Private Repository - Change nuget Package location Dynamically

Tags:

nuget

routing

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.

Is there a possibility to change the 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?

thanks in advance..

like image 392
Nagaraj M Avatar asked Oct 31 '22 10:10

Nagaraj M


1 Answers

option 1 : i have solved this issue by adding sub application for each platform and redirect to the nugetrepositary. it works fine now

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.

like image 114
Nagaraj M Avatar answered Jan 04 '23 13:01

Nagaraj M