Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mono & WInforms on OS X

I have just begun to explore the mono winforms environment and I cannot work out how to start a program from within monodevelop without a console session being started.

My simple program runs okay but when it exits a terminal session is always created & waiting for me to 'press any key'. I guess I could arrange things so that the terminal window closes automatically, but I would rather the app just ran 'natively', is this possible or does the way mono & .net function work preclude it?

As shown in the examples at Zetcode, in 'Main' the rest of the code is started with 'application.run(new aFunction());', I thought this might be the cause of the terminal session occurring but replacing it with:

myNewClass n = new myNewClass();
n.aFunction();

causes the program to not run at all (or maybe just exit without doing anything).

I am an experienced programmer but not familiar at all with C# or the mono/.net environment so 'stating the obvious' may be all that is required in an answer.

like image 246
blankabout Avatar asked Nov 18 '11 17:11

blankabout


1 Answers

MonoDevelop will usually let you start a program with or without it running in an external console.

In MonoDevelop 2.8 on Linux you can control this by context clicking on a project in the solution tree and selecting Options; then Run on external console under the Run section. I'm not sure if you can disable this on OSX.

like image 197
IanNorton Avatar answered Oct 03 '22 12:10

IanNorton