© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
2 replies
Daltz333

✅ MVVM Source Generator not copying attributes

It seems that if you do

[ObservableProperty, JsonIgnore]
private ImageSource _MyBadProperty;
[ObservableProperty, JsonIgnore]
private ImageSource _MyBadProperty;


It doesn't generate the
[JsonIgnore]
[JsonIgnore]
attribute on
MyBadProperty
MyBadProperty
, thus causing any serialization to fail since
ImageSource
ImageSource
throws an exception on attempted serialization. Any ideas of a workaround without just not using source generators?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Source generator not working?
C#CC# / help
12mo ago
source generator
C#CC# / help
3y ago
❔ Source generator & protobuf
C#CC# / help
4y ago
✅ Source Generator, dynamic assembly not added.
C#CC# / help
4y ago