System\Xml\Schema\DataTypeImplementation.cs (6)
3697throw new XmlSchemaException(SR.Format(SR.Sch_InvalidValue, s), e);
3719throw new XmlSchemaException(SR.Format(SR.Sch_InvalidValue, s), e);
3753throw new XmlSchemaException(SR.Format(SR.Sch_InvalidValue, s), e);
3793throw new XmlSchemaException(SR.Format(SR.Sch_InvalidValue, s), e);
3836throw new XmlSchemaException(SR.Format(SR.Sch_InvalidValue, s), e);
3889throw new XmlSchemaException(SR.Format(SR.Sch_InvalidValue, s), e);
System\Xml\Serialization\SoapReflectionImporter.cs (11)
139return new InvalidOperationException(SR.Format(SR.XmlReflectionError, context), e);
185throw new InvalidOperationException(SR.Format(SR.XmlInvalidTypeAttributes, model.Type.FullName));
219throw new NotSupportedException(SR.Format(SR.XmlUnsupportedSoapTypeKind, model.TypeDesc.FullName));
340throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, "DeferredWorkItems.Count have changed"));
342throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, "DeferredWorkItems.Top have changed"));
401throw new NotSupportedException(SR.Format(SR.XmlRpcRefsInValueType, model.TypeDesc.FullName));
403throw new NotSupportedException(SR.Format(SR.XmlRpcNestedValueType, member.TypeDesc.FullName));
426throw new NotSupportedException(SR.Format(SR.XmlRpcArrayOfValueTypes, model.TypeDesc.FullName));
502throw new InvalidOperationException(SR.Format(SR.XmlInvalidSoapArray, mapping.TypeDesc!.FullName));
541throw new InvalidOperationException(SR.Format(SR.XmlUdeclaredXsdType, dataType));
583throw new InvalidOperationException(SR.Format(SR.XmlNoSerializableMembers, model.TypeDesc.FullName));
System\Xml\Serialization\Types.cs (13)
381throw new NotSupportedException(SR.Format(SR.XmlSerializerUnsupportedType, FullName));
393_exception = new InvalidOperationException(SR.Format(SR.XmlConstructorInaccessible, FullName));
765throw new InvalidOperationException(SR.Format(SR.XmlUnsupportedOpenGenericType, type));
829exception = new InvalidOperationException(SR.Format(SR.XmlTypeInaccessible, type.FullName));
834exception = new InvalidOperationException(SR.Format(SR.XmlTypeStatic, type.FullName));
852exception ??= new NotSupportedException(SR.Format(SR.XmlSerializerUnsupportedType, type.FullName));
870exception ??= new NotSupportedException(SR.Format(SR.XmlUnsupportedRank, type.FullName));
889exception ??= new NotSupportedException(SR.Format(SR.XmlSerializerUnsupportedType, type.FullName));
944exception = new NotSupportedException(SR.Format(SR.XmlUnsupportedInterface, type.FullName));
956exception ??= new NotSupportedException(SR.Format(SR.XmlSerializerUnsupportedType, type.FullName));
1400throw new NotSupportedException(SR.Format(SR.XmlUnsupportedIDictionary, type.FullName));
1434throw new InvalidOperationException(SR.Format(SR.XmlNoDefaultAccessors, type.FullName));
1469throw new InvalidOperationException(SR.Format(SR.XmlInvalidArrayTypeSyntax, type));
System\Xml\Serialization\XmlReflectionImporter.cs (39)
130throw new InvalidOperationException(SR.Format(SR.XmlAnonymousInclude, type.FullName));
376return new InvalidOperationException(SR.Format(SR.XmlReflectionError, context), e);
381return new InvalidOperationException(SR.Format(SR.XmlTypeReflectionError, context), e);
386return new InvalidOperationException(SR.Format(model.IsProperty ? SR.XmlPropertyReflectionError : SR.XmlFieldReflectionError, model.Name), e);
423throw new InvalidOperationException(SR.Format(SR.XmlInvalidTypeAttributes, model.Type.FullName));
496throw new ArgumentException(SR.Format(SR.XmlGetSchemaMethodName, provider.MethodName), nameof(provider.MethodName));
594throw new InvalidOperationException(SR.Format(SR.XmlMissingSchema, baseQname.Namespace));
625return new InvalidOperationException(SR.Format(SR.XmlInvalidAttributeUse, type.FullName));
779throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, "DeferredWorkItems.Count have changed"));
781throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, "DeferredWorkItems.Top have changed"));
805throw new NotSupportedException(SR.Format(SR.XmlUnsupportedInheritance, model.Type.BaseType!.FullName));
881throw new InvalidOperationException(SR.Format(SR.XmlIllegalMultipleText, model.Type.FullName));
888throw new InvalidOperationException(SR.Format(SR.XmlMultipleXmlns, model.Type.FullName));
935throw new InvalidOperationException(SR.Format(SR.XmlMultipleXmlns, model.Type.FullName));
1177throw new InvalidOperationException(SR.Format(SR.XmlUdeclaredXsdType, dataType));
1212throw new InvalidOperationException(SR.Format(SR.XmlIllegalAttributeFlagsArray, model.TypeDesc.FullName));
1227throw new InvalidOperationException(SR.Format(SR.XmlNoSerializableMembers, model.TypeDesc.FullName));
1277throw new InvalidOperationException(SR.Format(SR.XmlInvalidAttributeType, "XmlAttribute"));
1322throw new InvalidOperationException(SR.Format(SR.XmlSequenceMembers, "Order"));
1452throw new InvalidOperationException(SR.Format(SR.XmlChoiceIdentifierTypeEnum, identifierName));
1491throw new InvalidOperationException(SR.Format(SR.XmlChoiceIdentifierAmbiguous, choice.MemberName));
1638throw new InvalidOperationException(SR.Format(SR.XmlIllegalArrayTextAttribute, accessorName));
1679throw new InvalidOperationException(SR.Format(SR.XmlSequenceMatch, "Order"));
1691throw new InvalidOperationException(SR.Format(SR.XmlIllegalAnyElement, arrayElementType.FullName));
1729throw new InvalidOperationException(SR.Format(SR.XmlSequenceMatch, "Order"));
1777if (a.XmlAnyElements.Count > 0) throw new InvalidOperationException(SR.Format(SR.XmlIllegalAnyElement, accessor.TypeDesc.FullName));
1782if (a.XmlAttribute.Type != null) throw new InvalidOperationException(SR.Format(SR.XmlIllegalType, "XmlAttribute"));
1808throw new InvalidOperationException(SR.Format(SR.XmlIllegalType, "XmlText"));
1825throw new InvalidOperationException(SR.Format(SR.XmlIllegalType, "XmlElement"));
1852throw new InvalidOperationException(SR.Format(SR.XmlSequenceMatch, "Order"));
1920throw new InvalidOperationException(SR.Format(SR.XmlSequenceMatch, "Order"));
1932throw new InvalidOperationException(SR.Format(SR.XmlIllegalAnyElement, accessorType.FullName));
1969throw new InvalidOperationException(SR.Format(SR.XmlSequenceMatch, "Order"));
1983throw new InvalidOperationException(SR.Format(SR.XmlRpcLitArrayElement, accessor.Elements[0].Name));
1986throw new InvalidOperationException(SR.Format(SR.XmlRpcLitXmlns, accessor.Name));
2032throw new InvalidOperationException(SR.Format(SR.XmlChoiceMissingAnyValue, accessor.ChoiceIdentifier.Mapping!.TypeDesc!.FullName));
2203throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, "Bad accessor type " + accessor.GetType().FullName));
2239throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, $"The XML attribute/element '{accessor.Namespace}{accessor.Name}' does not have an existing accessor to remove."));
2268if (isNullable && !typeDesc.IsNullable) throw new InvalidOperationException(SR.Format(SR.XmlInvalidIsNullable, typeDesc.FullName));
System\Xml\Serialization\XmlSchemaExporter.cs (15)
79throw new InvalidOperationException(SR.Format(SR.XmlBareAttributeMember, member.Attribute.Name));
81throw new InvalidOperationException(SR.Format(SR.XmlBareTextMember, member.Text.Name));
86throw new InvalidOperationException(SR.Format(SR.XmlIllegalArrayElement, member.Elements[0].Name));
287throw new InvalidOperationException(SR.Format(SR.XmlIllegalForm, e.Name));
293throw new InvalidOperationException(SR.Format(SR.XmlIllegalForm, a.Name));
509throw new InvalidOperationException(SR.Format(SR.XmlDuplicateNamespace, anyNs));
558throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, $"Unsupported anonymous mapping type: {mapping}"));
615throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, "Type " + mapping.TypeName + " from namespace '" + ns + "' is an invalid array mapping"));
677throw new InvalidOperationException(SR.Format(SR.XmlInvalidContent, type.ContentModel.Content!.GetType().Name));
872if (value.GetType() != typeof(string)) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, SR.Format(SR.XmlInvalidDefaultValue, value, value.GetType().FullName)));
912throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, "Mapping for " + pm.TypeDesc.Name + " missing type property"));
971if (!mapping.IncludeInSchema) throw new InvalidOperationException(SR.Format(SR.XmlCannotIncludeInSchema, mapping.TypeDesc.Name));
1046throw new InvalidOperationException(SR.Format(SR.XmlIllegalMultipleText, name));
1069throw new InvalidOperationException(SR.Format(SR.XmlInvalidContent, type.ContentModel.Content!.GetType().Name));
1138if (!mapping.IncludeInSchema) throw new InvalidOperationException(SR.Format(SR.XmlCannotIncludeInSchema, mapping.TypeDesc!.Name));
System\Xml\Serialization\XmlSerializationReader.cs (24)
960if (arrayInfo.dimensions != 1) throw new InvalidOperationException(SR.Format(SR.XmlInvalidArrayDimentions, CurrentTag()));
979throw new ArgumentNullException(nameof(value), SR.Format(SR.XmlMissingArrayType, CurrentTag()));
984throw new ArgumentException(SR.Format(SR.XmlEmptyArrayType, CurrentTag()), nameof(value));
1005throw new ArgumentException(SR.Format(SR.XmlInvalidArrayDimentions, CurrentTag()), nameof(value));
1018throw new ArgumentException(SR.Format(SR.XmlInvalidArrayLength, new string(lengthStringSpan)), nameof(value));
1034throw new ArgumentException(SR.Format(SR.XmlInvalidArrayDimentions, CurrentTag()), nameof(value));
1086throw new ArgumentException(SR.Format(SR.XmlInvalidArrayLength, dimensions[i]), "value");
1187throw new InvalidOperationException(SR.Format(SR.XmlUndefinedAlias, prefix));
1317return new InvalidOperationException(SR.Format(SR.XmlReadOnlyCollection, name));
1327return new InvalidOperationException(SR.Format(SR.XmlConstructorInaccessible, typeName));
1332return new InvalidOperationException(SR.Format(SR.XmlConstructorHasSecurityAttributes, typeName));
1337return new InvalidOperationException(SR.Format(SR.XmlUnknownNode, CurrentTag()));
1353return new InvalidCastException(SR.Format(SR.XmlInvalidNullCast, type.FullName));
1454if (!href.StartsWith('#')) throw new InvalidOperationException(SR.Format(SR.XmlMissingHref, href));
1505throw new InvalidOperationException(SR.Format(SR.XmlInvalidHref, id));
1607if (arrayInfo.dimensions != 1) throw new InvalidOperationException(SR.Format(SR.XmlInvalidArrayDimentions, CurrentTag()));
1693throw new NotSupportedException(SR.Format(SR.XmlRpcArrayOfValueTypes, elementType.FullName));
2485if (choiceSource == null) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, "Can not find " + member.ChoiceIdentifier.MemberName + " in the members mapping."));
2852if (enumMethodName == null) throw new InvalidOperationException(SR.Format(SR.XmlMissingMethodEnum, mapping.TypeDesc!.Name));
3096if (methodName == null) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorMethod, derived.TypeDesc!.Name));
3133if (methodName == null) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorMethod, enumMapping.TypeDesc!.Name));
4661if (methodName == null) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorMethod, element.Mapping.TypeDesc!.Name));
4817if (methodName == null) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorMethod, mapping.TypeDesc!.Name));
4907if (choiceSource == null) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, "need parent for the " + source));
System\Xml\Serialization\XmlSerializationWriter.cs (17)
547if (_objectsInUse.ContainsKey(o)) throw new InvalidOperationException(SR.Format(SR.XmlCircularReference, o.GetType().FullName));
593throw new InvalidOperationException(SR.Format(SR.XmlInvalidXmlns, alias));
705if (!_objectsInUse.ContainsKey(o)) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, "missing stack object of type " + o.GetType().FullName));
867if (typeof(IXmlSerializable).IsAssignableFrom(type)) return new InvalidOperationException(SR.Format(SR.XmlInvalidSerializable, type.FullName));
869if (!typeDesc.IsStructLike) return new InvalidOperationException(SR.Format(SR.XmlInvalidUseOfType, type.FullName));
870return new InvalidOperationException(SR.Format(SR.XmlUnxpectedType, type.FullName));
907return new InvalidOperationException(SR.Format(SR.XmlIllegalAnyElement, type.FullName));
1331if (!typeof(IEnumerable).IsAssignableFrom(type)) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, "not array like type " + type.FullName));
1844throw new InvalidOperationException(SR.Format(SR.XmlSerializerUnsupportedType, memberInfos[0]));
2455if (methodName == null) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorMethod, mapping.TypeDesc!.Name) + Environment.StackTrace);
2503if (defaultValue!.GetType() != typeof(string)) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, name + " has invalid default type " + defaultValue.GetType().Name));
2806if (enumSource == null) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, "Can not find " + member.ChoiceIdentifier.MemberName + " in the members mapping."));
3034if (methodName == null) throw new InvalidOperationException("derived from " + mapping.TypeDesc!.FullName + ", " + SR.Format(SR.XmlInternalErrorMethod, derived.TypeDesc.Name) + Environment.StackTrace);
3073if (methodName == null) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorMethod, mapping.TypeDesc.Name) + Environment.StackTrace);
4160if (methodName == null) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorMethod, structMapping.TypeDesc!.Name) + Environment.StackTrace);
4444throw new InvalidOperationException(SR.Format(SR.XmlUnsupportedDefaultType, type.FullName));
4553throw new InvalidOperationException(SR.Format(SR.XmlChoiceMissingAnyValue, choiceMapping.TypeDesc!.FullName));