protected Exception CreateUnknownTypeException(Type type)
{
if (typeof(IXmlSerializable).IsAssignableFrom(type)) return new InvalidOperationException(SR.Format(SR.XmlInvalidSerializable, type.FullName));
TypeDesc typeDesc = new TypeScope().GetTypeDesc(type);
if (!typeDesc.IsStructLike) return new InvalidOperationException(SR.Format(SR.XmlInvalidUseOfType, type.FullName));
return new InvalidOperationException(SR.Format(SR.XmlUnxpectedType, type.FullName));
}