1

I clicked on "Run a console project" and it said that the program was built successfully. But after that, I click "Run a console project" again and error like Cannot execute /path/file.exe appears as shown on the upper right corner of the screenshot. How can I fix this error?

Screenshot for the error

karel
  • 122,292
  • 133
  • 301
  • 332

2 Answers2

1

After you have created a new C# Console Project the way to build it in MonoDevelop is Build -> Build All. A message at the top of MonoDevelop should appear that says: Build successful. The way to run it is to select Run -> Run With -> Mono 4.x.x (4.x.x stands for the Mono JIT compiler version).

A new terminal will open and show these results:

Hello Mono!

Press any key to continue...

If you run it again without closing the terminal, a popup window will open with the following message:

An application is already running. Do you want to stop it?  

Click the Stop button to stop it and the C# program (Program.cs) will run again.

enter image description here

If your C# code ran successfully, you can find an executable file named Test3.exe in the .../bin/Debug folder of your console project. You can run Test3.exe from the terminal using this command:

mono /path/to/Test3.exe
karel
  • 122,292
  • 133
  • 301
  • 332
0

I know this post is old, but I still got this problem in 2023 and got another solution. According to this post, Monodevelop expects specific terminals, with xterm being the ultimate fallback. Since Wayland comes without xterm, no console could be started (which was meant to start your program then).

I solved this by installing xterm on my system.

paruk
  • 1