我们正在私有存储库中为ASP.NET Project中的私有nuget包工作。我们可以为每位客户更改nuget Feed。但是nuget包位于Web.Config中指定的位置。
是否有可能通过路由(URL)动态更改位置?即使包url引用webconfig文件中给出的路径
,我也已经对此博客http://blog.maartenballiauw.be/post/2011/05/09/Using-dynamic-WCF-service-routes.aspx进行了评论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>
&#34; NugetPackages&#34;是我的本地存储地址,我需要私下访问存储库,就像上面的位置有几个文件夹,我需要动态访问文件夹NugetPackages / folder1,NugetPackages / folder2这样,是否可能?
提前感谢..