I'm new to this so this may be a silly question.
I have just done a test disassembly on an exe file but it won't recompile as the generated code cobtains:
[CompilerGenerated]
private string <Body>k__BackingField;
[CompilerGenerated]
private string <InputString>k__BackingField;
[CompilerGenerated]
private string <Name>k__BackingField;

Why has it genertaed these statements - <Body> etc.?
steve48
0

Comments

1 comment

  • Clive Tong
    You are looking at C# 3.5 code with some property definitions of the form:
     int Foo &#123; get; set; &#125; 
    

    If you decompile with the settings as 2.0, you see the compiler generated code.
    &#91;CompilerGenerated&#93;
    private int &lt;Foo&gt;k__BackingField;
    
    private int Foo &#123; &#91;CompilerGenerated&#93; get; &#91;CompilerGenerated&#93; set; &#125;
    

    If you decompile at 3.5 then the compiler generated items are hidden, giving just the code
    private int Foo &#123; get; set; &#125;
    

    You can change the optimization level in View/Options/Optimization.
    Clive Tong
    0

Add comment

Please sign in to leave a comment.