vb.net - VB .Net - Reflection: Reflected Method from a loaded Assembly executes before calling method. Why? -


When I'm dynamically loading an assembly, then I'm calling it by a method, The method obtains by executing the code in that method which is calling it is not implemented in a serial manner as I expect if someone can have the light that why this is happening, to see some code below There are some codes that I see, some .dll Dhansba code'm puts adds a method called PerformLookup test I output the same messageBox type with "PerformLookup Time:". What I'm looking for:

First: "PerformLookup Time: 40: 842"

Second: "Init Index Time: 45: 873 "

  Import System Import System. Data import system IOO Import Microsoft.VisualBasic.Strings Import System Reflection public class class 1 public function initIndex (System.Collections.Hashtable as indexTable) as the System.Data.DataSet Dim writeCode string message box. ("InitIndex time:" & date.Now.Second.ToString () & amp; ":" & Date.Now.Millisecond.ToString ()) System.Threading .read.leep.leep (5000) WriteCode = RefreshList () End function Public function RefreshList () as slow down the system as ASM. Reflection.Assembly type as dim (T) Dim ty as follows dim MethodInfo (as M) Dim mm method as retString as dim string retString = "asm = System.Reflection.Assembly.LoadFrom ( Try "C: \ Program Files \ some.dll"). T = asm.GetTypes () ty = asm.GetType (t (28) .FullName) known class space m = ty.GetMethods () mm = ty. GetMethod ( "PerformLookup") object o = Activator.CreateInstance as dim (Ty) dimmed as object (), Riststring = mM. Invok (O, nothing) Kostring () catches as Akspasn & a Try retry Retrend End Function End Class I added a flush statement at the end of my writing method, though I had a StreamReader.Close () call. the result here is an attempt to diagnose debug been some output from the statement that I have it and so forth. write (timestamp) write (write protect timestamp) (file) (Avoid success) write (saved values) write (timestamp Write (create file) Write / timer / timer format) and write in the assembly method:  
  write (timestamp) Sleep (5 seconds) / / Yes To write and read (file), write between two (5 to 5 seconds) of sleeping time (file value) (time to write file / write file)  

Here is my output from the int index logfile:

1732 Sat A / P 17: 732 5/17/2010 11:59:30 AM / 5/18/2010 7 : 49 : 17 AM 22: 748

And the output from the assembly class logfile is given here:

  12: 670 cache 17: 685 5/17/2010 11:59:30 AM / 5/18/2010 7:41:20 AM  

Date is not as accurate as you think, you can just see that incompleteness.


Comments