Frage

I tried to use ngen.exe to get native image from CIL binary. This site explains that I can get the native image in %WINDIR%\assembly when I execute the ngen command for example, ngen install abc.exe, but I couldn't find one in my computer. I used Windows 7 64bit with VS2010.

  • Where/How can I find the native image after running the ngen?
  • Can I distribut the native image instead of the CIL binary?
War es hilfreich?

Lösung

I don't offhand know the answer to your first question, but it's moot because of the answer to the second question. No, you can't redistribute the native image, because it's tailored specifically to your computer: 32 vs 64-bit, Intel vs AMD, even processor generation (if you've got a newer processor, the generated code will take advantage of newer opcodes that won't exist on older-but-still-in-active-use processors).

You don't distribute native images. If your performance needs are such that you really need ngen, then typically your installer would invoke ngen and tell it to start generating native images in the background.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top