Question

Can Ngen be used as the perfect Code Obfuscator, protecting your .NET CIL from ever reaching the client?

Can I run Ngen on my dev PC and ship the exe to every client that has a compatible .NET framework version? (assuming both are x86 or x64) What are the differences between Ngen'd exe's across machines?

I know the latest Ngen generates an exe that contains the IL + Native code, which can be extracted and "converted" back to source code using something like Reflector. However, the ngen for .NET framework 1.1 strips out the IL in the generated exe, making it a possible choice for code security if you use .NET framework 1.1.

Was it helpful?

Solution

No, CLR requires IL assembly in order to locate the corresponding native image. So you would need to distribute IL binaries anyways. See this page for more info on how CLR locates Native Images: http://blogs.msdn.com/b/abhinaba/archive/2013/12/11/net-loading-native-ngen-images-and-its-interaction-with-the-gac.aspx

Besides, NGEN images are not designed to be distributed. Native image generation is tightly coupled with the machine it runs on.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top