Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

NegativeFieldOffset

FieldOffsetAttribute does not support negative numbers, and will result in a CS0591: Invalid value for argument to attribute, preventing compilation.

But can we work around this by defining a type with a negative FieldOffsetAttribute at runtime?

Conclusion

No, if a negative number is supplied, an ArgumentException will be thrown with the message "Invalid custom attribute provided."