-
Notifications
You must be signed in to change notification settings - Fork 63
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
Crc32 built-in extension, serialization exception "Reverse binding not allowed on FieldValue attributes" when used on Subtype field combined with SerializeWhen attribute #223
Comments
It should work. Is it not? |
It works only if the Crc property is placed after the Subtype field. If I put it before (as I need in my application), it throws this exception: Error serializing member 'Crc'. See inner exception for detail. InvalidOperationException: Reverse binding not allowed on FieldValue attributes. Consider swapping source and target. |
Yes, crc fields cannot appear before the data they are checking, as this is not strictly serialization. |
Any other way to solve my problem? Maybe using a ValueConverter? |
I tried to use the Crc32 built-in with my example using SerializeWhen and Subtypes (see #225 ). This is the code modification that I did:
The following exception is thrown: Error serializing member 'Crc'. See inner exception for detail. If I put the Crc32 attribute only on the first SerializeWhen option it seems to work, no excepion is generated:
@jefffhaynes could you please take a look, if related to #225 fix |
I believe the issue is that the crc can only be used on a single field. If you need to calculate it over multiple fields, simply create a container class for those fields. |
Is it possible to use the Crc32 built-in extension to calculate the checksum over a subtype field? For example in this class from PcapNgNet, how can a new field be added to calculate the Crc32 for the "BlockBody Body" field?
The text was updated successfully, but these errors were encountered: