简体   繁体   中英

Ngen output of C# executable is not valid Win32 application

I have a windows console application on C# that I'm trying to compile natively, because I need it to run on machines that don't have .Net 4.0 . I used ngen.exe and grabbed the output (myproject.ni.exe) and the DLL's, but when I copy it to another machine and try to run the exe it says it's not a valid win32 application. am I missing something?

Thanks.

Yes, NGen does not produce executable/native DLL, it does produce pre-JIT-ed code to be used with .Net assembly.

There are other tools (ie see Compiling C# to Native? ) that may create standalone executable out of .Net assemblies, but NGen is not one of them.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM