PC Review


Reply
Thread Tools Rate Thread

Assembly linking

 
 
Atul Godbole
Guest
Posts: n/a
 
      18th May 2005
Suppose an assembly "Main" is using class "A" from another Assembly "Dep" as
follows :

A a = new A();
a.MethodOne();

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? 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).

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?

If so, this should suggest that at least some part of the linking is done
during load-time.

Any explanations, doc references, online article references would be
appreciated.

Regards
Atul


 
Reply With Quote
 
 
 
 
Mattias Sjögren
Guest
Posts: n/a
 
      18th May 2005
>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.
 
Reply With Quote
 
Jeffrey Tan[MSFT]
Guest
Posts: n/a
 
      18th May 2005
Hi Atul,

For this issue, I have added a reply to you in
microsoft.public.dotnet.general newsgroup, please check it there, I will
follow up with you. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linking the same code to different versions of assembly carlos Microsoft C# .NET 2 8th Mar 2008 03:49 AM
Linking or Compiling Dependencies into a .Net Assembly Benny Microsoft VC .NET 1 14th Dec 2007 09:39 PM
Problem linking assembly to existing Excel file =?Utf-8?B?QnJpYW4gV29sZmU=?= Microsoft Excel Programming 0 7th Mar 2007 11:51 PM
Assembly linking Atul Godbole Microsoft Dot NET 3 20th May 2005 02:33 AM
correctly embedding or linking a resource file into an assembly Sanjay Tibrewal Microsoft ASP .NET 0 14th Nov 2003 08:32 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:13 PM.