Koozali.org: home of the SME Server

Help running Mono .EXE on SME8

Offline Jáder

  • *
  • 1,099
  • +0/-0
    • LinuxFacil
Help running Mono .EXE on SME8
« on: October 30, 2011, 08:06:11 PM »
Hi
After install mono on SME8 I ask programming guys to create a .exe so I can test it running on apache.
After some time (more than a week) I got a .msi file (argh!)
Already ask them to pack as .zip only... anyways, I start to try to run the program.
So I run installer under wine on Ubuntu on other machine, copy folder files (incluing several DLLs and one .exe) to a folder on mono installation.
Now when I try to get it running I just get an download window for .exe file!
So I think apache is not understanding .exe as a mono app!
The /var/log/httpd/access_log shows:
Code: [Select]
mydomain.com 192.168.47.100 - - [30/Oct/2011:17:02:17 -0200] "GET /mono-test/ProjetoMonoLinux.exe HTTP/1.1" 200 172032 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:7.0.1) Gecko/20100101 Firefox/7.0.1"

Can someone give some idea what's wrong here ?

Thank you

Jáder
...

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Help running Mono .EXE on SME8
« Reply #1 on: October 30, 2011, 08:43:13 PM »
Executables are meant to be run standalone. If you want stuff to run under mono on apache my guess is you need .a dll or .so file.
I am unfamiliar with mono, but I think you are trying to do things the hard (and possibly) wrong way. IIRC Mono is the Linux equivalant of ASP.net.
I am also unsure if you can run applications compiled on windows under mono the way you are doing. Here is more on mono and apache: http://www.mono-project.com/Mod_mono
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline Jáder

  • *
  • 1,099
  • +0/-0
    • LinuxFacil
Re: Help running Mono .EXE on SME8
« Reply #2 on: October 30, 2011, 09:36:28 PM »
cactus

Thanks by your help.
I see... maybe I'm just trying the wrong thing...
I was following http://wiki.contribs.org/Mono and had missed to see the mod_mono template for apache do not say anything about .exe... just about .aspx and others!

Can someone more familiar with apache/mono/mod_mono confirm this ?

Thanks

Jáder
...

Offline mmccarn

  • *
  • 2,651
  • +10/-0
Re: Help running Mono .EXE on SME8
« Reply #3 on: October 31, 2011, 01:08:16 PM »
I can think of two things to try:

1) add a line for .exe to your custom mono template fragment:

Open the custom template fragment:
Code: [Select]
cd /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf
mcedit 20LoadModule80mod_mono
add a line that says:
     AddType application/x-asp-net .exe
save the results (F2)
and exit (F10)

Activate your changes:
Code: [Select]
expand-template /etc/httpd/conf/httpd.conf
sv t httpd-e-smith

or,

2) Try renaming the '.exe' file as a '.dll' file and see what happens.


Offline Jáder

  • *
  • 1,099
  • +0/-0
    • LinuxFacil
Re: Help running Mono .EXE on SME8
« Reply #4 on: October 31, 2011, 01:49:32 PM »
None of them works! :(
I'm talking with programmer guys about this... and I'll let you know when I learn more about it.

for future references:
1) add .exe line on mod_mono templates changes nothing (offer to download .exe file)
2) rename file from .exe to .dll makes server reply:
Code: [Select]
Server Error in '/mono-test' Application
This type of page is not served.

Description: HTTP 403. The type of page you have requested is not served because it has been explicitly forbidden. The extension '.dll' may be incorrect. Please review the URL below and make sure that it is spelled correctly.

Requested URL: /mono-test/Teste.dll
Version information: Mono Runtime Version: 2.10.2 (tarball Mon Apr 18 18:57:39 UTC 2011); ASP.NET Version: 2.0.50727.1433

3) rename file from .exe to .aspx show code on browser
4) rename file from .exe to .so  changes nothing (offer to download .so file)
...

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Help running Mono .EXE on SME8
« Reply #5 on: October 31, 2011, 04:20:31 PM »
That renaming does not work is not a surprise to me. When compiling on windows a lot of libraries are linked on compile time, most likely not all of them are available on linux, even when mono is installed.
Do you really need to develop in ASP? Is there no option to use something else like perl or php that can be run more easily on both platforms?
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline Jáder

  • *
  • 1,099
  • +0/-0
    • LinuxFacil
Re: Help running Mono .EXE on SME8
« Reply #6 on: October 31, 2011, 08:17:48 PM »
I also expect that rename do not work... but I had nothing to loose! :)

I'm trying to use a new version of old program the users already are used to!
The old version is Win Only... running in VMWARE on a Ubuntu Only network (ARGH!). ... but get even worst: it's M$ ACCESS (forms + database!) ;)
The new version is C# (ASP)  + Oracle (free version!)... so I have a change to install mono on each Ubuntu computer and run it better than now.
I'd prefer to use a single instalation on server with Mono on server... but I'm not sure if this is the way or a possible way. Right now I'm sign in a Mono forum to learn about this! :)
I'll keep you all informed.

Regards

Jáder
...