0

I have an application compiled as GUI winforms. If any parameters are passed I am trying to start is as a console app instead of winforms app so I have been looking at following article.

There is explained two methods to do this: visual studio and ildasm.exe.

I am interested in ildasm.exe method which uses editbin.exe to mark gui winform app as a console application at startup.

So:

  1. Where can I obtain editbin.exe
  2. How to mark gui winform app as console app from c# using editbin.exe, some example?
  3. If need to run as GUI mode, it relaunches itself as a GUI app, how to relaunch winform app? any example?
Willy
  • 9,848
  • 22
  • 141
  • 284
  • 1
    That sounds *extremely* clunky. The clunkiness of this is of epic proportions. You would be much better off keeping winforms app separate from console app, and either always launching the console app and having it launch the winforms app if it does not have anything to do, or (better) always launching the winforms app, and if it discovers any parameters, it launches the console app and terminates. – Mike Nakis May 19 '17 at 12:10
  • You have no use for ildasm.exe. Editbin.exe is included with the C++ compiler workload, default install location is the vc/bin subdirectory. You need the /SUBSYSTEM option, example [is here](http://stackoverflow.com/a/8839388/17034). More convoluted for VS2017. – Hans Passant May 19 '17 at 13:18

0 Answers0