Ngen.exe

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • whezker
    New Member
    • Dec 2007
    • 7

    #1

    Ngen.exe

    Hi everybody.
    I'm trying to use the ngen tool from framework 2.0, to accelerate the load runtime of my app.
    I'll explain here what I'm doing.

    First I copy&paste the ngen.exe to the Bin folder of my project (to not have to especify the path), where is the .exe of my app.

    Then, in the CMD, i go to the same folder to execute the ngen, and I've tried differents ways to create the native image.

    One way was create the aimages of the .exe and the .dll separatedly:
    ngen MyApp.exe
    ngen MyDll.dll

    That creates both images.

    Another way was creating at the same time.

    ngen MyApp.exe, "MyDll.dll"

    with the same result.

    Note: I've didn't spicificated the version or the publickeytoken, cause I've readed that this is only useful when you have differents version of the same DLL.


    Ok, the problem comes here. I've tried a test, generating the images and delete the DLL from the folder, to see if the executable file uses the native image of the DLL instead of the DLL file in the folder.
    But the application fails to open.

    I'm not sure if I've done well the native images, and I don't know exactly how to invoke them later.

    I'm so noob, and don't know much about compilators and stuff like that, so, if anyone can explain to me how to use ngen I will thank a lot.

    I saw the documentation of the MSDN and readed some articles from teh web, but all that was too tachnical for me. I like to try with some simple example or something for DUMMIES like me.

    Thanks a lot and please, excuse my english.

    :)
  • radcaesar
    Recognized Expert Contributor
    • Sep 2006
    • 759

    #2
    Whats the error u got ?

    Comment

    • whezker
      New Member
      • Dec 2007
      • 7

      #3
      I guess that you are talking about error when I'm trying to open the app.
      That errors happens when I delete the DLL from the Bin folder to test if the executable uses the native image instead of the DLL file and execute the project.

      When I execute it, windows shows me a dialog.
      "MyApp has detected a problem and must close. We are sorry for the inconvenients"

      that was teh translation of
      "MyApp ha detectado un problema y debe cerrarse. Sentimos los inconvenientes ocasionados."

      The dialog has the debugger button and "send errors" button.

      I think that the error is that he can't find the DLL, but well, what I'm looking for is to use the NATIVE IMAGE of it.

      I like a tutorial for dummies to explain how to create it and use it.


      Thanks a lot

      Comment

      Working...