Is it possible after using Net Reflector and getting the source code of the program, to use the form editor, if the decompiled program was a WinForm application?

Now I do not see the form editor.

    2 answers 2

    Update

    The new version of the Windows Forms Designer (Visual Studio 2015) has become smarter, and parses the code for you (see the answer @Sergey Rufanov).

    In it, editing should work without additional effort. Which, by the way, is very difficult in terms of implementation.

    The remainder of the response applies to older versions of Visual Studio.


    Not.

    Decompilers recover the code - and only this is their task. They will not restore the source code of the application, they will only find the source code that will be compiled into the same (or approximately the same) file. Here is a discussion of the issue on the Reflector support forum.

    They do not restore the internal file structure needed for Forms Editor, do not restore comments and names of internal variables, do not split classes into partial-parts, as the Windows Forms Editor wants.

    You will have to figure out how the code, which Forms Editor requires, and arrange the decompiled code to this view manually. Look at how Stephen Cleary coped with the task , he describes what changes he made in the code.

    Nobody said that reverse engineering is an easy task.

    • one
      Does not require a studio of what you specified. The current version is sufficient to have a class derived from Form. And how this class was created is absolutely not important. - Sergey Rufanov
    • one
      @VladD, Sergey Rufanov - right. - Alexis

    Yes of course. Virtually all current versions of existing decompilers normally restore forms, including the .Net Reflector you mentioned.

    • And how can I get the form? So I decompile the prog, but I don’t see any forms anywhere ... - iluxa1810
    • @ iluxa1810, Add the application to Reflector, right-click on the assembly, select "Export Source Code", open the project in Visual Studio, double-click on the form class in the studio - the editor of this form appears. - Sergey Rufanov
    • @ iluxa1810, Maybe you have an old studio. In 2010, for example. the form editor broke at any deviation from the norm. In 2015, the form editor eats away anything thanks to Roslyn - the main thing is that you have a class in the file that inherits from the Form - Reflector provides for itself. - Sergey Rufanov
    • Hm What about partial classes like those found in designer.cs? Are they no longer required? - VladD
    • 2
      @SergeyRufanov: Cool, Roslyn taxis. - VladD