How to convert .NET exe to native Win32 exe?

How to convert .NET exe to Win32 exe? (I have no code) The goal is to run the application on Linux using wine. I assume that .NET exe cannot be run in fault, and I do not want to use mono.

+4
source share
6 answers

depending on which version of .NET it is and what libraries it uses, you can try to run it in Mono without compiling IL to your own code.

most Linux distributions are available in their package management systems.

see http://www.mono-project.com/Main_Page for more details

NGen (http://blogs.msdn.com/clrcodegeneration/archive/2007/09/15/to-ngen-or-not-to-ngen.aspx). , WINE.

+3

, , , .

.net VMWare Thinapp. , win32.

https://www.vmware.com/products/thinapp

+2

, ?

+1

. A.k.a. mkbundle on mono

Mono JIT- AOT ( ). , .o, , mono runtime . , .NET.

, hughe exe, , ,

mono --aot=static

          static Create  an  ELF  object file (.o) which can be statically linked into an executable when embedding the mono runtime. When this option is used, the object
                 file needs to be registered with the embedded runtime using the mono_aot_register_module function which takes as its argument the mono_aot_module_<ASSEM‐
                 BLY NAME>_info global symbol from the object file:

                 extern void *mono_aot_module_hello_info;

                 mono_aot_register_module (mono_aot_module_hello_info);

linux, , .

. mkbundle:

sehe@sehelap:~$ mkbundle --static test.exe -o hello
OS is: Linux
Note that statically linking the LGPL Mono runtime has more licensing restrictions than dynamically linking.
See http://www.mono-project.com/Licensing for details on licensing.
Sources: 1 Auto-dependencies: False
   embedding: /home/sehe/test.exe
Compiling:
as -o temp.o temp.s 
cc -o hello -Wall `pkg-config --cflags mono` temp.c  `pkg-config --libs-only-L mono` -Wl,-Bstatic -lmono -Wl,-Bdynamic `pkg-config --libs-only-l mono | sed -e "s/\-lmono //"` temp.o
Done
sehe@sehelap:~$ ./hello 
hello world

sehe@sehelap:~$ ldd hello 
linux-gate.so.1 =>  (0xb7875000)
libdl.so.2 => /lib/libdl.so.2 (0xb785f000)
libpthread.so.0 => /lib/libpthread.so.0 (0xb7845000)
libm.so.6 => /lib/libm.so.6 (0xb781e000)
libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0xb7819000)
librt.so.1 => /lib/librt.so.1 (0xb7810000)
libglib-2.0.so.0 => /lib/libglib-2.0.so.0 (0xb7741000)
libc.so.6 => /lib/libc.so.6 (0xb75e4000)
/lib/ld-linux.so.2 (0xb7876000)
libpcre.so.3 => /lib/libpcre.so.3 (0xb75af000)
+1

It’s just not possible. For managed code, you need some kind of virtual machine to run. On Linux, you can use Mono or dotgnu portable.net. Maybe some hyper-advanced version of the wine will one day be able to launch the MS.net infrastructure?

0
source

All Articles