Imagine this enum in a DLL.
public enum Colors
{
Red,
Green
}
Does adding enum values break binary compatibility? If I were to change it, would existing EXEs break?
public enum Colors
{
Red,
Green,
Blue
}
I saw this answer, but it seemed to address the case of inserting a value. If I add values to the end only, is that OK?
No, this doesn't break binary compatibility (in as much as: the assembly will still load etc), because enums are basically integer literal constants. Inserting values in the middle is obviously a really dangerous idea, but you've already excluded that.
However, it can cause a number of other issues that you need to guard against:
switch
statements in particular) may not anticipate the new values; technically this was an issue before too, since enums are not value-checked (enum variables can contain undefined values)