How to fix base addresses for NGEN

Posted by: mikedempsey on 8 September 2017, 4:35 am EST

  • Posted 8 September 2017, 4:35 am EST

    All your assemblies appear to use the same base address - 0x11000000.

    I am trying to speed up the load time for my app by installing all third party assemblies in the GAC and using NGEN to pre-compile them.
    However you assemblies will still be relatively slow to load due to the fact that they will all need to be re-based.

    Microsoft appear to use the approx address range 65000000 -> 7C000000
                                              while Infragistics use 62000000 -> 65000000

    Your assemblies would therefore fit nicely in the 60000000 -> 62000000 range but I don't see a parameter in NGEN that allows me to specify the base address to use. Is there a way to force them to be re-based?

    Based on their sizes (after NGEN) the following addresses work with this set of dlls:

    60000000  FarPoint.Win.dll               <- Size 00280000
    60300000  FarPoint.Win.Spread.dll   <- Size 00AF0000
    60E00000  FarPoint.Excel.dll             <- Size 00250000
    61100000  FarPoint.PDF.dll              <- Size 00100000
    61200000  FarPoint.CalcEngine.dll    <- Size 00100000
    61300000  FarPoint.PluginCalendar.WinForms.dll <- Size 00070000 



  • Replied 8 September 2017, 4:35 am EST

    Mike -

    <font size="2" color="navy" face="Arial"><span style="font-size:10pt;font-family:Arial;color:navy;">It doesn't look there is any way to do what you want unless we make you a special build.  That
    NGEN tool does not support any way to specify a base address for the binary
    image it makes for an assembly.  Apparently you have to compile the “preferred
    base address” into the assembly itself.<o:p></o:p></span></font>

    <font size="2" color="navy" face="Arial"><span style="font-size:10pt;font-family:Arial;color:navy;"><o:p> </o:p></span></font>

    <font size="2" color="navy" face="Arial"><span style="font-size:10pt;font-family:Arial;color:navy;">Link:</span></font>


  • Replied 8 September 2017, 4:35 am EST

    That's what I thought.
    I was hoping there was something I had missed in the docs.

    Is there any chance you plan to set specific (non-overlapping) base addresses for future releases?

    I realize that you can't define address ranges that will not conflict with any other assembly, but you could assign addresses that dont overlap with each other, or with the most common major vendors. (I only know the ranges used by Microsoft and Infragistrics - you may know of other packages that are commonly used along with your product that would make the addresses I proposed a bad choice.)


  • Replied 8 September 2017, 4:35 am EST

    We can change the base address that is compiled into our assemblies, but there is not any way to avoid the potential for conflicting with other assemblies.

    What you really need is an update for NGEN that supports specifying a base address for the image that it generates. Have you asked Microsoft about that?  I would imagine that they have had many requests for such an enhancement.

  • Replied 8 September 2017, 4:35 am EST

    I'll give it a try ... but getting Microsoft to change something is usually like pushing a boulder up-hill!

    What would be really good is if the major assembly vendors could decide amoung themselves what range of addresses each company would use. Something on the lines of the the way the radio spectrum is divided by the FTC.
    (There are only a few major vendors - at least 2 of whom already use non-conflicting ranges. [Microsoft and Infragistics]  I dont know if DBI Tech or ComponentOne set base addresses or not.)

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels