Uchenna

NotSupportedException: Collection was of a fixed size.

net Icon

System.NotSupportedException

Collection was of a fixed size.

An unhandled exception occurred on line 304
301
        {
302
            if (targetUserId == fromUserId)
303
            {
304
                aliasIndicies?.Add(SearchConstants.OnlyMeIndex);
305
            }

Solution

I used Array.Empty<string>(); to create an empty array string. I then tried to later add an item to that array causing it to fail. I fixed this by using new List<string>(); instead.            
Mar 24, 2021 Anyone

0 replies


Install the browser extension

Found this solution helpful? Try our extension for quick solutions to your .NET errors.

Chrome logo Add to Chrome - It's free