Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Cannot execute binary file - Mono program

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Programming
View previous topic :: View next topic  
Author Message
donoreo
LXF regular


Joined: Mon Apr 11, 2005 2:49 pm
Posts: 788
Location: Toronto, Ontario, Canada

PostPosted: Wed Feb 04, 2009 1:56 pm    Post subject: Cannot execute binary file - Mono program Reply with quote

I am stuck on the firs project from Paul's coding academy! I am getting the error above. I cannot run the program from a command prompt. It runs fine in MonoDevelop. Permissions are fine. Googling turns up a lot of the same problem with scripts, but not much that helps me. Ideas?
_________________
I cannot deny anything that I did not say.
Back to top
View user's profile Send private message
M-Saunders
LXF regular


Joined: Mon Apr 11, 2005 1:14 pm
Posts: 2893

PostPosted: Wed Feb 04, 2009 2:07 pm    Post subject: RE: Cannot execute binary file - Mono program Reply with quote

Are you trying to run the program with ./progname? You might need to try mono progname.

M
Back to top
View user's profile Send private message Visit poster's website
donoreo
LXF regular


Joined: Mon Apr 11, 2005 2:49 pm
Posts: 788
Location: Toronto, Ontario, Canada

PostPosted: Wed Feb 04, 2009 2:10 pm    Post subject: RE: Cannot execute binary file - Mono program Reply with quote

Hmmmm yes, it apparently does need that. Paul's tutorial did not mention it, just ./progname . I may just be the first person working on it with all the time I have being unemployed still Sad Thanks.
_________________
I cannot deny anything that I did not say.
Back to top
View user's profile Send private message
Hudzilla
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 265
Location: LXF Towers

PostPosted: Wed Feb 04, 2009 2:22 pm    Post subject: RE: Cannot execute binary file - Mono program Reply with quote

Hey!

Yes, you probably need to use "mono ToDoList.exe". I didn't mention it because on Ubuntu ./ToDoList.exe works fine Smile

I'll add it.


Paul
Back to top
View user's profile Send private message Visit poster's website
Ram
LXF regular


Joined: Thu Apr 07, 2005 10:44 pm
Posts: 1667
Location: Guisborough

PostPosted: Wed Feb 04, 2009 3:58 pm    Post subject: RE: Cannot execute binary file - Mono program Reply with quote

./ works fine on 8.10 but I've found with 8.04 (Dell Mini 9 version) I have to use mono ?.exe

One question if I can highjack this tread, var contents = File.ReadAllText does work for me, gives an error on build. Works if I change it to string contents. This is with 8.04 as above, not had time to try it on 8.10 yet so is this a quirk of 8.04 ?
_________________

lubuntu LXDE 13.10 running on AMD Phenom II*4; ASUS Crosshair III Formula MB; 4 GB Ram.....
Back to top
View user's profile Send private message MSN Messenger
donoreo
LXF regular


Joined: Mon Apr 11, 2005 2:49 pm
Posts: 788
Location: Toronto, Ontario, Canada

PostPosted: Wed Feb 04, 2009 4:05 pm    Post subject: RE: Cannot execute binary file - Mono program Reply with quote

I am using Suse 11.1.
_________________
I cannot deny anything that I did not say.
Back to top
View user's profile Send private message
ollie
Moderator


Joined: Mon Jul 25, 2005 12:26 pm
Posts: 2749
Location: Bathurst NSW Australia

PostPosted: Wed Feb 04, 2009 11:37 pm    Post subject: RE: Cannot execute binary file - Mono program Reply with quote

Is the location of "mono" part of your PATH variable with the correct permissions to access?

See Setting your Path.
Back to top
View user's profile Send private message
Ram
LXF regular


Joined: Thu Apr 07, 2005 10:44 pm
Posts: 1667
Location: Guisborough

PostPosted: Thu Feb 05, 2009 8:29 am    Post subject: RE: Cannot execute binary file - Mono program Reply with quote

Cheers for that Ollie, I'll check my PATH on the Mini 9

As for the issue with var, just setup up vbox running 8:10 and no error.
_________________

lubuntu LXDE 13.10 running on AMD Phenom II*4; ASUS Crosshair III Formula MB; 4 GB Ram.....
Back to top
View user's profile Send private message MSN Messenger
tj-blues



Joined: Sun Apr 25, 2010 12:46 am
Posts: 3
Location: Mississauga, ON, Canada

PostPosted: Sun Apr 25, 2010 1:40 am    Post subject: Re: RE: Cannot execute binary file - Mono program Reply with quote

ollie wrote:
Is the location of "mono" part of your PATH variable with the correct permissions to access?

See Setting your Path.


PATH has not much to do with it. Your post confused me for a while so I checked: and yes, mono is installed in /usr/bin directory. But, think, it got to be in PATH because it's sufficient to call "mono program" and not "./mono program".

But still the question is valid - how to make it work without need of issuing "mono" before programname?
cheers
Back to top
View user's profile Send private message
LeoP



Joined: Wed Jun 09, 2010 1:23 pm
Posts: 1

PostPosted: Wed Jun 09, 2010 1:28 pm    Post subject: Re: RE: Cannot execute binary file - Mono program Reply with quote

tj-blues wrote:
But still the question is valid - how to make it work without need of issuing "mono" before programname?


Most distros will install binfmt-support with mono, but many will chose not to enable it: Try
Code:
sudo update-binfmts --display

and see, if it has an entry like "cli (disabled):". If yes, then
Code:
sudo update-binfmts --enable cli

is your friend.
Back to top
View user's profile Send private message
Ram
LXF regular


Joined: Thu Apr 07, 2005 10:44 pm
Posts: 1667
Location: Guisborough

PostPosted: Wed Jun 09, 2010 5:54 pm    Post subject: Re: RE: Cannot execute binary file - Mono program Reply with quote

tj-blues wrote:
ollie wrote:
Is the location of "mono" part of your PATH variable with the correct permissions to access?

See Setting your Path.


PATH has not much to do with it. Your post confused me for a while so I checked: and yes, mono is installed in /usr/bin directory. But, think, it got to be in PATH because it's sufficient to call "mono program" and not "./mono program".

But still the question is valid - how to make it work without need of issuing "mono" before programname?
cheers


tj, if your path is correct then you run it like ./prog.exe as you would with a sh script - no need to ref mono.
_________________

lubuntu LXDE 13.10 running on AMD Phenom II*4; ASUS Crosshair III Formula MB; 4 GB Ram.....
Back to top
View user's profile Send private message MSN Messenger
tj-blues



Joined: Sun Apr 25, 2010 12:46 am
Posts: 3
Location: Mississauga, ON, Canada

PostPosted: Sat Jun 19, 2010 3:29 am    Post subject: Re: RE: Cannot execute binary file - Mono program Reply with quote

Ram wrote:

tj, if your path is correct then you run it like ./prog.exe as you would with a sh script - no need to ref mono.


As I said before - correct PATH will only point system to /usr/bin directory. It doesn't give any references how the system has to deal with ".exe" file.
I run Suse 11.1 and every time I want to execute C# program I need to type "mono" first.
Back to top
View user's profile Send private message
Ram
LXF regular


Joined: Thu Apr 07, 2005 10:44 pm
Posts: 1667
Location: Guisborough

PostPosted: Sat Jun 19, 2010 6:10 pm    Post subject: Reply with quote

Hi tj,

You confused me with ./ before mono " it's sufficient to call "mono program" and not "./mono program". "

Anyway have a read of the Registering .exe as non-native binaries (Linux only) section.

Ram
_________________

lubuntu LXDE 13.10 running on AMD Phenom II*4; ASUS Crosshair III Formula MB; 4 GB Ram.....
Back to top
View user's profile Send private message MSN Messenger
tj-blues



Joined: Sun Apr 25, 2010 12:46 am
Posts: 3
Location: Mississauga, ON, Canada

PostPosted: Sat Jun 19, 2010 9:49 pm    Post subject: Reply with quote

Ram wrote:
Hi tj,

You confused me with ./ before mono " it's sufficient to call "mono program" and not "./mono program". "

Anyway have a read of the Registering .exe as non-native binaries (Linux only) section.

Ram


Thanks a lot - this should help. But I think I wont use it because I run other .exe files for ex. with Wine.

cheers
Back to top
View user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast