Why does ImmutableArray seem to not be there in Microsoft Immutable Collections NuGet package version 1.0.34?
ImmutableArray
is not present in your version of the library.
As you can see in the version history, the release notes for 1.1.20 mention "Re-included ImmutableArray<T>"
You can find the explanation for why ImmutableArray was absent from the 1.0 version on the .NET blog, in this announcement. (In short - the Roslyn team had a noticeable performance hit when they tried to use that type instead of regular arrays, and the team in charge of the library was not sure how to fix that, while keeping a reasonable API.)
You will find newer versions of the library under its new NuGet package, System.Collections.Immutable
.
N.B.: According to the source code in the new versions of System.Collections.Immutable
, they have apparently decided to take the API hit - that is, some operations on a unitialized ImmutableArray
will throw a surprising NullReferenceException
s. Clearly, ImmutableArray
should never be instantiated with new
. (ImmutableArray<T>.Empty
should be used instead)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With