dotnet/wpf · error · NotSupportedException

This feature is not supported.

Error message

This feature is not supported.

What it means

NotSupportedException from the DataSpaceManager transform-host setter: this property exists to satisfy the ITransformFeatures interface but the setter is explicitly not implemented (SR.NYIDefault). The feature is recognized by the format but this library never supports setting it. The value is checked for disposal first, then the setter always throws.

Solutions

  1. Do not set this property; treat it as read-only metadata produced by the transform infrastructure
  2. Avoid transforms that require this feature flag, or pre-author the file with a tool that writes the flag directly
  3. File/verify support in a newer runtime if the feature is genuinely required

Example fix

// before
transformHost.Features[i].RequiresTransformInstanceData = true; // throws NotSupportedException
// after
// Do not set; leave transform feature defaults as written by the format.
bool requires = transformHost.Features[i].RequiresTransformInstanceData; // read is allowed
Defensive patterns

Strategy: try-catch

Validate before calling

// Avoid calling setters on transform feature flags; read-only access is safe:
// var v = feature.SomeFlag; // OK

Try / catch

try { feature.SomeFlag = value; } catch (NotSupportedException) { /* setter intentionally unimplemented; skip */ }

Prevention

When it happens

Trigger: Assigning to the corresponding ITransformFeatures property (feature-flag setter for a registered transform) via a DataSpaceManager transform host on an open compound file.

Common situations: Developers trying to toggle transform features (e.g. rights-management or compression transform flags) programmatically on OPC compound-file packages.

Related errors


AI-assisted analysis of dotnet/wpf@81131a70a4 (2026-09-14). Data as JSON: /api/errors/6d8556685c2abc84. Report an issue: GitHub.

Appendix: source

Thrown at src/Microsoft.DotNet.Wpf/src/WindowsBase/System/IO/Packaging/CompoundFile/DataSpaceManager.cs:1806

    {
        transformHost = host;
        transformLabel = instanceLabel;
    }

    /// <summary>
    /// Whether this transform demands that all instance data of other
    /// transform above it in the transform stack be transformed too
    /// </summary>
    internal bool RequireOtherInstanceData
    {
        get
        {
            return false;
        }
        set
        {
            transformHost.CheckDisposedStatus();
            throw new NotSupportedException(
                SR.NYIDefault);
        }
    }

    /// <summary>
    /// Whether this transform demands that its own instance data be
    /// free from other data transformation
    /// </summary>
    internal bool RequireInstanceDataUnaltered
    {
        get
        {
            return false;
        }
        set
        {
            transformHost.CheckDisposedStatus();
            throw new NotSupportedException(

View on GitHub (pinned to 81131a70a4)