By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,650 Members | 1,785 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,650 IT Pros & Developers. It's quick & easy.

NGEN and resolving assemblies

P: n/a
Wol
I have two assemblies, A.dll and B.dll.

A.dll contains two methods. One method, UsesB, uses a type from B.dll
whereas the other, DoesNotUseB, does not.

To cache a native image of A.dll with both methods precompiled, I believe I
can do

ngen A.dll B.dll

I think I could also do

ngen B.dll
ngen A.dll

Will just

ngen A.dll

also produce a native image of A.dll with both methods precompiled, or will
it precompile only the method that does *not* use types from B.dll? (or will
it precompile neither?)

In other words, does

ngen A.dll

resolve B.dll and use the metadata in B.dll to work out the physical layout
of the types in B.dll so that it can generate native code for A.UsesB(), or
does it need B.dll to be in the native image cache already, or do I actually
have to supply both dlls to ngen at the same time, ie

ngen A.dll B.dll

TIA
Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"ngen A.dll" is not the same as "ngen A.dll B.dll". The latter will
pre-compile both assemblies.

"ngen A.dll" will load B automatically (through the normal assembly probing
logic), and compile both methods.

To prove it, run "ntsd ngen A.dll", you will see b.dll in the loaded module
list, assuming b.dll can be found by ngen.
"Wol" <mr***@hotmail.com> wrote in message
news:O8**************@TK2MSFTNGP10.phx.gbl...
I have two assemblies, A.dll and B.dll.

A.dll contains two methods. One method, UsesB, uses a type from B.dll
whereas the other, DoesNotUseB, does not.

To cache a native image of A.dll with both methods precompiled, I believe I can do

ngen A.dll B.dll

I think I could also do

ngen B.dll
ngen A.dll

Will just

ngen A.dll

also produce a native image of A.dll with both methods precompiled, or will it precompile only the method that does *not* use types from B.dll? (or will it precompile neither?)

In other words, does

ngen A.dll

resolve B.dll and use the metadata in B.dll to work out the physical layout of the types in B.dll so that it can generate native code for A.UsesB(), or does it need B.dll to be in the native image cache already, or do I actually have to supply both dlls to ngen at the same time, ie

ngen A.dll B.dll

TIA

Jul 19 '05 #2

P: n/a
The ngen image of A will use indirections (similar to IATs in the unmanaged
world) to access data from B.dll. (In the next version, these indirections
can be removed).

We will resolve the physical layout of types in B. So if B.dll changes, you
need to re-ngen A.dll as the old ngen image is/may be invalid and will not
be used anymore.

"Wol" <mr***@hotmail.com> wrote in message
news:O8**************@TK2MSFTNGP10.phx.gbl...
I have two assemblies, A.dll and B.dll.

A.dll contains two methods. One method, UsesB, uses a type from B.dll
whereas the other, DoesNotUseB, does not.

To cache a native image of A.dll with both methods precompiled, I believe I can do

ngen A.dll B.dll

I think I could also do

ngen B.dll
ngen A.dll

Will just

ngen A.dll

also produce a native image of A.dll with both methods precompiled, or will it precompile only the method that does *not* use types from B.dll? (or will it precompile neither?)

In other words, does

ngen A.dll

resolve B.dll and use the metadata in B.dll to work out the physical layout of the types in B.dll so that it can generate native code for A.UsesB(), or does it need B.dll to be in the native image cache already, or do I actually have to supply both dlls to ngen at the same time, ie

ngen A.dll B.dll

TIA

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.