[Mono-list] Mono, Windows Forms, and Headless operation

Timotheus Pokorra timotheus.pokorra at solidcharity.com
Fri Jan 8 07:13:26 UTC 2016

Hello George,

> Question First:
> The main question I had for the Mono list is this.  Is it possible to have
> mono run Windows Forms code without trying to open X11 (I.e. headless mode)?
> What triggers mono to request an X11 display? Is it the project type?  Is it
> the call to an object that inherits from a Windows Forms control?  I don’t
> need to see the form, but if I’m using BackgroundWorkers, I need the form's
> event handler, don’t I?

You should try to modify the project type, ie OutputType in the csproj
file, WinExe vs Exe.

> I know this may be confusing, and if so, please feel free to ask for
> clarifications, or even just to say “Why would you want to do that?”

I wonder if you could cleanly separate the business logic from the
gui. Then you can have a dll with the business logic, which you can
reference from your winforms forms, but also from your console

hope this helps,

More information about the Mono-list mailing list