0

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

0

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
  • i clicked to run with and it showed a window with 2 tab, general and advance. In the advance i can choose mono 5.2.0 or the default but nothing work – Hieu Tran Trong Sep 10 '17 at 14:16
  • i just figure out that i uncheck run on external console in option run with, i can see the result just like netbean, inside the IDE. But some others cannot run. I want it can run normal when i click 'run without debug" and it can run on terminal. It seem like it need some set up for this to run like i want? – Hieu Tran Trong Sep 10 '17 at 14:23
  • mono 5.2.0 is not the same version of mono that is installed by the mono-complete package from the default Ubuntu repositories. For example, in my 16.04 the results of apt policy mono-complete are mono-complete: Installed: 4.2.1.102+dfsg2-7ubuntu4 and the results of apt policy monodevelop are monodevelop: Installed: 5.10.0.871-2 and my C# programs worked from the beginning out of the box with no additional setup or configuration required. – karel Sep 10 '17 at 20:22
  • It appears from your comment that you have installed mono 5.2.0 Stable release (the latest version) from the official Mono website instead of the default Ubuntu mono-complete package. In case you are wondering about it, you don't need the latest versions of mono-complete or monodevelop to run .NET programs either: askubuntu.com/questions/905528/… – karel Sep 10 '17 at 20:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.