6

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.

4
  • Your question is not clear. The reason your terminal session is not closing could be a system setting. The code you posted does not make any sense. Unless the class you are starting inherits from a Form then Application.Run(myNewClass) won't work. What type of application are you planning on making this? I am actually shocked that Mono even as Application.Run since its suppose to be limited to Windows applications based on the documentation. Commented Nov 18, 2011 at 18:03
  • I took a quick look at the page, there is NOTHING to indicate this code would work on any other operating system other then Windows with Mono installed. You cannot use a Windows Form on any other operating system other then Windows. Commented Nov 18, 2011 at 18:08
  • @RamHound Well, the code does work on operating systems other than Windows otherwise I would not have a problem. Maybe I have misunderstood something but why else would mono exist other than to provide a portable platform for .net programs? Commented Nov 18, 2011 at 19:28
  • @Ramhound MWF works very well on OSX. I think you misunderstand there Commented Nov 18, 2011 at 19:48

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Found the 'run' options under the Project/program Options menu. Does exactlt what it says on the tin so thank you for pointing me in the right direction.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.