-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: Sitaraman
Message 1 in Discussion

Hi   Was checking out the solution of some query posted in Chennai.Net group and ended 
up in a query of my own   lets say i have three web projects     
http://localhost/DummyProj1     http://localhost/DummyProj2     
http://localhost/DummyProj3   All these projects contain one file each          
http://localhost/DummyProj1/webform1.aspx       
http://localhost/DummyProj2/webform1.aspx       
http://localhost/DummyProj3/webform1.aspx   Note that name of the aspx and codebehind  
files is same in all three projects((WebForm1.aspx and WebForm1.aspx .vb)).  I have 
also given the same namespace in all three projects- which is DummyProj   I refer to 
the code behind in my aspx files as follows   <%@ Page Language="vb" 
AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" Inherits="DummyProj.WebForm1"%>  
 In the codebehind of       DummyProj1/webform1.aspx.vb - i print Response.write("In 
DummyProj1")   DummyProj1/webform1.aspx.vb - i print Response.write("In DummyProj2")   
DummyProj1/webform1.aspx.vb - i print Response.write("In DummyProj3")   Now i build 
all these applications and run them, they work fine   The fun part is -   I copy the  
http://localhost/DummyProj1/bin/DummyProj1.dll and 
http://localhost/DummyProj2/bin/DummyProj2.dll  to  the  
http://localhost/DummyProj3/bin  directory   Now my understanding is that whenever the 
aspx file is loaded,  all the assemblies in the corresponding bin directories are 
loaded in the mmory( due to the process model setting - add assemblies="*" in the 
machine.config).  So in this case DummyProj1.dll, DummyProj2.dll and the 
DummyProj3.dll are all loaded.  Now all these assemblies contain the type 
DummyProj.WebForm1   Now the DummyProj.WebForm1  of which assembly will the aspx use 
for the inherits clause.  I tried it out    it used the 
http://localhost/DummyProj3/bin/DummyProj3.dll as it printed "In DummyProj3" , which 
is perfect .     But if i delete this DummyProj3.dll,  and reload the page, it  does 
not throw an exception.  Instead  it happily loaded the type from  
http://localhost/DummyProj3/bin/DummyProj2.dll and printed "In DummyProj2".    If i 
delete the DummyProj2.dll , then it uses the 
http://localhost/DummyProj3/bin/DummyProj1.dll and prints "In DummyProj1".    I 
understand that there is no explicit linking in a aspx file to an assembly. But in 
this case wat is the logic that the runtime uses  to find a type.  Is it ok for the 
runtime to load two assemblies with the same namespace.class.  Even if it is ok,  wat  
made the runtime to use the DummyProj2.dll first.  is it time-stamp based???       
regards,   sr

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to