>At what time is the call to MethodOne linked to the actual MSIL (method
>body) of the method? Does this occur when "Main" is build or does it happen
>when main is loaded and Jitted?
Depends on what you mean by "linked". At compile time there's enough
information stored in the Main assembly to locate MethodOne in the A
class in the Dep assembly.
>Also is the linking achieved by the full
>method name( this is what is seen in the IL generated by ILDASM : e.g : call
>System.String.ctor() ) or is it linked using a fixed number ( say its
>ordinal in the class function table).
By name and signature, no magic numbers.
>The reason I am asking this is what will happen if I add another method
>"MethodTwo" to class "A" without changing the version of the assembly "Dep".
>Will the "Main" assembly continue to run without the need to recompile?
Yes.
>If so, this should suggest that at least some part of the linking is done
>during load-time.
Well yes, the actual method to call is looked up by name at runtime.
Mattias
--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ |
http://www.dotnetinterop.com
Please reply only to the newsgroup.