Does the structure of a C# file affect what is compiled?
For example, would the order of members (in terms of where in the file it exists) affect the compiled class?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
According to a blog entry from Eric Lippert I read the other day, the compiler does not guarantee two compilations of the same source to end up the same IL. This wasn’t about method ordering, though, but I think that applies too – so, I don’t think it is safe to assume any method ordering in the compiled class. I also wouldn’t expect any connection between source file method ordering and IL method ordering.