C
C#5w ago
thegu5

Error in Json Source Generation (ambiguous operator)

I'm trying to serialize a list of asmresolver's TypeDefinitions to json. This includes its Utf8String type: https://github.com/Washi1337/AsmResolver/blob/78ce89adebcc7e5dbeb1d4a1a35afcd513fb87a1/src/AsmResolver/Utf8String.cs the generated c# is throwing an error here:
GitHub
AsmResolver/src/AsmResolver/Utf8String.cs at 78ce89adebcc7e5dbeb1d4...
A library for creating, reading and editing PE files and .NET modules. - Washi1337/AsmResolver
No description
4 Replies
thegu5
thegu55w ago
are there any workarounds to fix this? or should I just disable AOT compilation and go with reflection instead
Angius
Angius5w ago
I'd maybe try a custom serializer for this type that just translates it to a plain ol' string I'd certainly raise an issue on the library's repo, too
reflectronic
reflectronic5w ago
well, the issue should probably be raised on dotnet/runtime the generated source code should likely be changed to avoid this error
thegu5
thegu55w ago
I ended up going with a different solution (not serializing this in the first place), but thanks for the tips might come back to this and dig a bit further w/ dotnet/runtime