Custom types with the Configuration-binding source generator #94686
Unanswered
jamescrosswell
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to get source generated configuration binders working with the settings for our library. Or settings class has a number of properties with custom types and this causes the binding to fail.
For example, trying to create a binding for the following type:
This produces a couple of warnings:
... and if I ignore the warnings and just run the program anyway, stepping into the generated code I see:
So the generated code just throws an
InvalidOperationException
... With the source generators for JsonSerialization, it's easy enough to work around things like this by providing custom JsonConverters. What's the recommended way of dealing with this for Confituration Binding Source Generators though?Beta Was this translation helpful? Give feedback.
All reactions