Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8632251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:19:34+00:00 2026-06-12T09:19:34+00:00

Imagine this enum in a DLL. public enum Colors { Red, Green } Does

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T09:19:35+00:00Added an answer on June 12, 2026 at 9:19 am

    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:

    • some code (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)
    • anything that queries the available enums is going to get different results
      • in particular, serialization and deserialization may fail unexpectedly if there is data using enums that aren’t yet expected by the particular client
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Imagine this: Class A{ private int a; } Class B{ public void fn(){ A
Imagine this structure: /project /templates view1.haml view2.haml misc_views/ view3.haml view4.haml even_deeper/ view5.haml /public script1.js
Imagine I have defined the following Enum: public enum Status : byte { Inactive
imagine this html on a page <div id=hpl_content_wrap> <p class=foobar>this is one word and
Imagine this scenario: in our company there is an employee that play around graphic,css,html
Imagine this subroutine: sub test(&&) { my $cr1 = shift; my $cr2 = shift;
Imagine this simple form <form action=<?php echo $_SERVER['REQUEST_URI']; ?> method=post> <fieldset> <legend>Contact Me</legend> <label
Imagine this scenario: You have a desktop and a laptop. The desktop has a
Imagine this as the code from build.xml: <project name=test project> <target name=first> <echo>first</echo> </target>
Imagine this simplified markup: <div id=header> <!-- Other things.... --> <div id=detail> </div> </div>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.