AvaloniaUI/Avalonia · warning · InvalidOperationException

Concurrent operations are not supported.

Error message

Concurrent operations are not supported.

What it means

Centralized ThrowHelper.ThrowInvalidOperationException_ConcurrentOperationsNotSupported throws InvalidOperationException "Concurrent operations are not supported." It is a vestigial helper ported from the BCL (used there by concurrent collections' non-concurrent members). In this Avalonia codebase it has no active call site; PooledList/PooledStack are not concurrent collections and do not route any method to it.

Source

Thrown at src/Avalonia.Base/Collections/Pooled/ThrowHelper.cs:324

            throw new InvalidOperationException("Collection was modified during enumeration.");
        }

        [DoesNotReturn]
        internal static void ThrowInvalidOperationException_InvalidOperation_EnumOpCantHappen()
        {
            throw new InvalidOperationException("Invalid enumerator state: enumeration cannot proceed.");
        }

        [DoesNotReturn]
        internal static void ThrowInvalidOperationException_InvalidOperation_NoValue()
        {
            throw new InvalidOperationException("No value provided.");
        }

        [DoesNotReturn]
        internal static void ThrowInvalidOperationException_ConcurrentOperationsNotSupported()
        {
            throw new InvalidOperationException("Concurrent operations are not supported.");
        }

        [DoesNotReturn]
        internal static void ThrowInvalidOperationException_HandleIsNotInitialized()
        {
            throw new InvalidOperationException("Handle is not initialized.");
        }

        [DoesNotReturn]
        internal static void ThrowFormatException_BadFormatSpecifier()
        {
            throw new FormatException("Bad format specifier.");
        }

        private static ArgumentException GetArgumentException(ExceptionResource resource)
        {
            return new ArgumentException(GetResourceString(resource));
        }

View on GitHub (pinned to 11c5427268)

Solutions

  1. Unreachable via public APIs — verify no internal/forked caller is involved.
  2. If you need thread-safe access to a PooledList/PooledStack, use your own locking rather than expecting a concurrent collection.
  3. Audit the call stack if it appears unexpectedly.
Defensive patterns

Strategy: validation

Validate before calling

// Unreachable via public APIs. For thread-safe PooledList/PooledStack access,
// use external locking instead of expecting a concurrent collection.

Prevention

When it happens

Trigger: Not reachable through public Avalonia collection APIs — no method invokes this helper. It would only surface from a custom/internal call site.

Common situations: Seeing it implies a fork added a caller; otherwise it is unused dead code. Not something a normal Avalonia consumer triggers.

Related errors


AI-assisted analysis of AvaloniaUI/Avalonia@11c5427268 (2026-08-13). Data as JSON: /api/errors/f8b0ea1372ea7cc4. Report an issue: GitHub.