Skip to content

Microsoft.XmlSerializer.Generator not supported DateOnly and TimeOnly #122712

@kronic

Description

@kronic

Description

Microsoft.XmlSerializer.Generator not supported DateOnly and TimeOnly

Reproduction Steps

using System;

namespace ClassLibrary1;

public class Class1
{
	public DateOnly Date { get; set; }
	public TimeOnly Time { get; set; }
}
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net10.0</TargetFramework>
    <Nullable>enable</Nullable>
  </PropertyGroup>
	<PropertyGroup>
		<SGenTypes>ClassLibrary1.Class1;</SGenTypes>
		<SGenProxyTypes>false</SGenProxyTypes>
		<SGenVerbose>true</SGenVerbose>
	</PropertyGroup>
	<ItemGroup>
		<DotNetCliToolReference Include="Microsoft.XmlSerializer.Generator" Version="10.0.1" />
		<PackageReference Include="Microsoft.XmlSerializer.Generator" Version="10.0.1" />
	</ItemGroup>
</Project>

Expected behavior

Support types DateOnly and TimeOnly

Actual behavior

not working

Regression?

no

Known Workarounds

No response

Configuration

net 10.0

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions