Unhandled error on request from TeamCity nuget feed, unvalid version string

A package with the wrong version number has gotten into the nuget feed that we set up on our TeamCity server, and is now causing issues when creating a new release.

I don’t know how to clean out the TeamCity nuget feed. We fixed the version string on our packages, so the future packages will get the proper number. This error however, persists.

I am able to release by manually typing in the package number.

Here is the error I get when I click “Search” to see what packages were recently built:

System.ArgumentException: ‘1.5–development’ is not a valid version string.
Parameter name: version
at NuGet.SemanticVersion.Parse(String version)
at NuGet.DataServicePackage.NuGet.IPackageName.get_Version()
at System.Linq.EnumerableSorter2.ComputeKeys(TElement[] elements, Int32 count) at System.Linq.EnumerableSorter1.Sort(TElement[] elements, Int32 count)
at System.Linq.OrderedEnumerable1.<GetEnumerator>d__1.MoveNext() at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext()
at System.Linq.Enumerable.Any[TSource](IEnumerable1 source) at Octopus.Core.Packages.ExternalNuGetFeedAdapter.<GetVersions>d__7.MoveNext() in Y:\work\refs\tags\3.2.24\source\Octopus.Core\Packages\ExternalNuGetFeedAdapter.cs:line 51 at System.Linq.Enumerable.<SkipIterator>d__301.MoveNext()
at System.Linq.Enumerable.d__241.MoveNext() at System.Collections.Generic.List1…ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)
at Octopus.Server.Web.Api.Actions.PackageSearchAction.Search(String feedId, String packageId, Boolean partialMatch, Boolean includeMultipleVersions, Boolean includeNotes, Boolean includePreRelease, Int32 take, IVersionSpec versionRange, Regex preReleaseTag) in Y:\work\refs\tags\3.2.24\source\Octopus.Server\Web\Api\Actions\PackageSearchAction.cs:line 70
at Octopus.Server.Web.Api.Actions.PackageSearchAction.Execute() in Y:\work\refs\tags\3.2.24\source\Octopus.Server\Web\Api\Actions\PackageSearchAction.cs:line 55
at Octopus.Server.Web.Infrastructure.Api.Responder`1.Respond(TDescriptor options, NancyContext context) in Y:\work\refs\tags\3.2.24\source\Octopus.Server\Web\Infrastructure\Api\Responder.cs:line 162
at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
at Octopus.Server.Web.Api.OctopusRestApiModule.<>c__DisplayClass0_0.<.ctor>b__0(Object o) in Y:\work\refs\tags\3.2.24\source\Octopus.Server\Web\Api\OctopusRestApiModule.cs:line 46
at Nancy.Routing.Route.<>c__DisplayClass4.b__3(Object parameters, CancellationToken context)

Octopus version 3.2.24
TeamCity version 10.0.5 (build 42677)


Thanks for getting in touch! This file will have to be deleted from your TeamCity feed. In current versions you should be able to complete this task by deleting the build that created the artifact.
This function is available via the Actions drop down, and selecting Remove. If that option is not available to you for some reason there is quite a thread over on StackOverflow which gives various ways to delete a package from their feed:

Hope this helps! Let me know how this goes.