icsharpcode/ILSpy · error · NotSupportedException

{ser}

Error message

{ser}

What it means

Thrown at the end of PropertyCustomHandler.Deserialize when the record's serializer KnownTypes id is none of the handled converters (DependencyPropertyConverter, EnumConverter, BooleanConverter, XamlBrushSerializer, XamlPathDataSerializer, the Point/Vector3D/Point3D collection serializers, XamlInt32CollectionSerializer). NotSupportedException(ser.ToString()) reports the offending KnownTypes value.

Source

Thrown at ICSharpCode.BamlDecompiler/Handlers/Records/PropertyCustomHandler.cs:166

							{
								for (int i = 0; i < count; i++)
									sb.AppendFormat(CultureInfo.InvariantCulture, "{0:D}", reader.ReadUInt16());
							}
							break;
							case IntegerCollectionType.I4:
							{
								for (int i = 0; i < count; i++)
									sb.AppendFormat(CultureInfo.InvariantCulture, "{0:D}", reader.ReadInt32());
							}
							break;
							default:
								throw new NotSupportedException(type.ToString());
						}
						return sb.ToString().Trim();
					}
				}
			}
			throw new NotSupportedException(ser.ToString());
		}

		private bool NeedsFullName(XamlProperty property, XamlContext ctx, XElement elem)
		{
			XElement p = elem.Parent;
			while (p != null && p.Annotation<XamlType>()?.ResolvedType.FullName != "System.Windows.Style")
			{
				p = p.Parent;
			}
			var type = p?.Annotation<TargetTypeAnnotation>()?.Type;
			if (type == null)
				return true;
			return property.IsAttachedTo(type);
		}

		public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent)
		{
			var record = (PropertyCustomRecord)((BamlRecordNode)node).Record;

View on GitHub (pinned to 60c08fcb74)

Solutions

  1. Identify the serializer id (ser) in the message and check whether a newer ILSpy supports it.
  2. Re-extract from a clean assembly to rule out corruption.
  3. Report the unsupported serializer.
Defensive patterns

Strategy: try-catch

Try / catch

try {
    SafeDecompile(bamlResource);
} catch (NotSupportedException) {
    // a PropertyCustom serializer this build cannot handle
}

Prevention

When it happens

Trigger: A PropertyCustom record references a serializer type id that this handler does not implement.

Common situations: BAML using an uncommon XAML serializer; a newer serializer id; corrupted serializer id byte.

Related errors


AI-assisted analysis of icsharpcode/ILSpy@60c08fcb74 (2026-08-13). Data as JSON: /api/errors/4261258ce160f236. Report an issue: GitHub.