开发者

Creating and distributing native image with ngen.exe

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.ex开发者_如何学运维e, 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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜