Domanda

I have written a web application with my own server in C# using Monodevelop. On my computer I compile it and run it without any problems. However, I tried to deploy it on a server, and after successful compilation of .sln file with xbuild and running .exe file I get:

"Cannot execute binary file."

Obviousle .exe has +x flag. Here is result of uname:

uname -a

Linux xxxxx 3.10.19-2 #1 SMP Thu Nov 14 10:42:59 CET 2013 x86_64 Intel(R)_Xeon(R)CPU___X7460_@_2.66GHz PLD Linux

And here is result of file

file Server.exe

Server.exe: PE32 executable (console) Intel 80386 Mono/.Net assembly, for MS Windows

So I run a 32-bit app on 64-bit machine, which should be ok. "For MS Windows" is quite disturbing, but on my computer file command gives the same output. Here is result of uname on my computer:

uname -a

Linux xxxxx 3.13.6-1-ARCH #1 SMP PREEMPT Fri Mar 7 22:30:23 CET 2014 i686 GNU/Linux

However, .exe file is not a Unix script. I can run it under Wine on my computer, but Wine is not available on the server. What can I do to run my app on the server?

È stato utile?

Soluzione

Most Linux distribution does not ship with Mono, so you have to,

  1. Install Mono according to the distribution manuals. Sounds like you are using a Debian derivative, then you should run sudo apt-get install mono-complete.
  2. Run your binary by calling mono your.exe.
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top