When running a .net program on Ubuntu I have to type in "mono foo.exe" instead of just foo.exe or double-clicking the icon. Is there any way to just run foo.exe?
Does this link help? Running Mono
From the Mono Project on using binfmt:
Registering .exe as non-native binaries (Linux only)
Because this is a Linux-specific feature, we do not recommend that developers deploy this solution, as it would limit the portability of their scripts.
In addition, this mechanism does not work as intended by the Application Deployment Guidelines.
You can also make a systemwide change, and use binfmt to register the exe files as non-native binaries. Then, when trying to launch an exe file, the kernel will run the mono interpreter to handle the command. Binfmt can also be used to launch Windows executables using WINE, or Java .class files using a JVM. To register exe with the kernel:
Become root and turn on the binfmt module in your kernel with this command:
In addition, you may want to add that command to your /etc/rc.local boot script, so that it will be executed on boot.
Add the line below to your /etc/fstab file:
Then, have your system run the following command on boot:
Be sure to mark your .exe files as executable in the filesystem as well:
Note that this doesn't change your kernel, just the modules that it loads when you boot your system. In other words, you can still upgrade your kernel without worrying about losing these changes. Similarly, you can upgrade your Mono runtime without affecting any of the invocation methods listed in this section.
Create a startup script.
Open a plain text editor, add this:
Depending on your setup, you may need to use the full path for foo.exe.
Save the file for example as
Make it executable:
You should now be able to start foo.exe by double-clicking
You can associate the file extension '.exe' on Nautilus to be executed with