Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DateIOnly/TimeOnly support to XmlSerializer and DataContractSerializer #56711

Open
eiriktsarpalis opened this issue Aug 2, 2021 · 11 comments
Labels
area-Serialization Priority:2 Work that is important, but not critical for the release
Milestone

Comments

@eiriktsarpalis
Copy link
Member

Are XmlSerializer and DataContractSerializer also going to be supported?

Originally posted by @LaughingJohn in #51302 (comment)

@dotnet-issue-labeler dotnet-issue-labeler bot added area-Serialization untriaged New issue has not been triaged by the area owner labels Aug 2, 2021
@StephenMolloy StephenMolloy added the Priority:2 Work that is important, but not critical for the release label Sep 30, 2021
@StephenMolloy StephenMolloy added this to the 7.0.0 milestone Sep 30, 2021
@StephenMolloy StephenMolloy removed the untriaged New issue has not been triaged by the area owner label Sep 30, 2021
@drieseng
Copy link
Contributor

@eiriktsarpalis Is this one up for grabs? Not committing to anything yet, but I may have some time (and interest) for this.

@eiriktsarpalis
Copy link
Member Author

I defer to the area owners of serialization cc @StephenMolloy

@ThaDaVos
Copy link

ThaDaVos commented May 4, 2023

It seems, almost 2 years later, this hasn't picked up yet sadly

@kirsan31
Copy link

Yes, I was very surprised to find this problem. 😯

@JosepBalague
Copy link

JosepBalague commented Jul 12, 2023

Still failing in 7.0.306

Despite forcing new types like that XmlSerializer ser = new(typeof(MyClass), new Type[] { typeof(DateOnly), typeof(TimeOnly) });
code fails. Please watch output:

<?xml version="1.0" encoding="utf-16"?> <MyClass xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Value_do /> <--- MISSING VALUE <Value_to /> <--- MISSING VALUE <Value>2023-07-12T17:05:37.4485796+02:00</Value> </MyClass>

I attach the code.

Cheers
Serialize_MS.zip

Maximys pushed a commit to Maximys/runtime that referenced this issue Aug 29, 2023
Maximys pushed a commit to Maximys/runtime that referenced this issue Aug 29, 2023
Maximys pushed a commit to Maximys/runtime that referenced this issue Aug 29, 2023
Maximys pushed a commit to Maximys/runtime that referenced this issue Aug 29, 2023
…rc\System\Xml\Serialization\Types.cs" to separate namespace and files.
Maximys pushed a commit to Maximys/runtime that referenced this issue Aug 29, 2023
Maximys pushed a commit to Maximys/runtime that referenced this issue Aug 29, 2023
@rgroenewoudt
Copy link

@Maximys I see a few related commits. Would you be willing to work on a pull request?

@Maximys
Copy link
Contributor

Maximys commented Oct 24, 2023

@Maximys I see a few related commits. Would you be willing to work on a pull request?

Yes, @rgroenewoudt , I'll try to continue my work

@dgolub
Copy link

dgolub commented Jan 7, 2024

Is anyone actively working on this issue? If not, I'd be willing to consider getting involved.

@LordBenjamin
Copy link

@eiriktsarpalis @StephenMolloy is there any plan to progress this? EF Core 8 now scaffolds DateOnly and TimeOnly properties by default when it encounters a SQL date or time column. I have updated all of my DTOs accordingly, only to find that the DCS does not support these types.

I am unable to work around using ISerializationSurrogateProvider to (de)serialize as a DateTime also (possibly a separate bug report).

@InsanelyOne
Copy link

This needs to be dealt with soon! Now that EF 8 is scaffolding DateOnly/TimeOnly properties, this is a big FAIL!

@HongGit HongGit modified the milestones: 8.0.0, 9.0.0 May 23, 2024
@eiriktsarpalis eiriktsarpalis modified the milestones: 9.0.0, Future Aug 13, 2024
@eiriktsarpalis
Copy link
Member Author

Moving to Future as feature development for .NET 9 is now completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Serialization Priority:2 Work that is important, but not critical for the release
Projects
None yet
Development

No branches or pull requests