diff --git a/WinRT.Runtime/TypeNameSupport.cs b/WinRT.Runtime/TypeNameSupport.cs index c1b11de88..c6025c981 100644 --- a/WinRT.Runtime/TypeNameSupport.cs +++ b/WinRT.Runtime/TypeNameSupport.cs @@ -110,6 +110,7 @@ public static Type ResolvePrimitiveType(string primitiveTypeName) "Double" => typeof(double), "Guid" => typeof(Guid), "Object" => typeof(object), + "TimeSpan" => typeof(TimeSpan), _ => null }; } @@ -199,7 +200,7 @@ public static string GetNameForType(Type type, TypeNameGenerationFlags flags) private static bool TryAppendSimpleTypeName(Type type, StringBuilder builder, TypeNameGenerationFlags flags) { - if (type.IsPrimitive || type == typeof(string) || type == typeof(Guid)) + if (type.IsPrimitive || type == typeof(string) || type == typeof(Guid) || type == typeof(TimeSpan)) { if ((flags & TypeNameGenerationFlags.GenerateBoxedName) != 0) {