Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.
If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!
System.InvalidCastException: Unable to cast object of type 'Inedo.ProGet.Feeds.Npm.NpmFeed' to type 'Inedo.ProGet.IRepackageFeed'
-
Having upgraded from Proget 5.3 to 6.0.1, a previously working script we have used many times on the promotions API is now failing when promoting packages on an NPM feed.
Issue #1: The 'ToFeed' param is now required in the JSON. Previously you could omit this if the feed was configured to have a Promote To Feed setting configured.
Issue #2: Calling the promotion API always returns the following error.
Unhandled exception processing http://proget.internal/api/promotions/promote
System.InvalidCastException: Unable to cast object of type 'Inedo.ProGet.Feeds.Npm.NpmFeed' to type 'Inedo.ProGet.IRepackageFeed'.
at Inedo.ProGet.WebApplication.SimpleHandlers.Api.PackagePromotion.PromotePackageApiHandler.ProcessRequestAsync(HttpContext context, LoggedResponseStream output, WebApiContext apiContext) in C:\Users\builds\AppData\Local\Temp\InedoAgent\BuildMaster\192.168.44.60\Temp_E155545\Src\ProGet.WebApplication\SimpleHandlers\Api\PackagePromotion\PackagePromotionApiHandler.cs:line 98
at Inedo.ProGet.WebApplication.SimpleHandlers.Api.ProGetApiKeySecuredHandler.ProcessRequestInternalAsync(HttpContext context, LoggedResponseStream output, WrappedApiKey apiKey) in C:\Users\builds\AppData\Local\Temp\InedoAgent\BuildMaster\192.168.44.60\Temp_E155545\Src\ProGet.WebApplication\SimpleHandlers\Api\ProGetApiKeySecuredHandler.cs:line 45
at Inedo.Web.Handlers.Api.ApiKeySecuredHandler.ProcessRequestInternalAsync(HttpContext context)
at Inedo.Web.Handlers.Api.StandardApiHandler.ProcessRequestAsync(HttpContext context)
-
Hi @forcenet_4316,
Thanks for finding this for us. This looks to be a regression due to our recent API key changes. We have fixed this in our upcoming ProGet 6.0.2 release that is due out on Friday. These fixes are tracked in PG-2033 and PG-2034.
Thanks,
Dan
-
@Dan_Woolf Version 6.0.2 (Build 5) still has the same issue as PG-2034, at least on NPM feeds, possibly others.
-
Hi @forcenet_4316,
Thanks for bringing this to our attention. I'm not sure how this slipped through, but I made sure it is fixed in the next release, ProGet 6.0.3. The final fix is tracked via PG-2043.
Thanks,
Rich