Reflection.Assembly.LoadFrom 
Author Message
 Reflection.Assembly.LoadFrom

Hi

We are using Reflection.Assembly.LoadFrom to load our DLL's from a
HTTP-server.
Isn't this function supposed to download the DLL only if it's newer than
the version
in the download cache? As it is now, the DLL is downloaded everytime,
even when
another form from the same DLL is already visible.

Are we doing something wrong?

The code that loads the main form (the code that loads other forms look
the same, but
are spread over multiple functions, as they are called from menu click
events):

Module F4all
    Const url As String = "http://sql99/f4all/"
    Sub main()
        Dim dll As Reflection.Assembly
        Dim param(0) As Object
        dll = Reflection.Assembly.LoadFrom(url & "f4allmdi.dll") ', sec)

        'Get the Form from the assembly
        Dim formtype As Type = dll.GetType("F4AllMdi.frmMain")

        'Create an instance of the Form
        Dim FormObj As Object
        param(0) = url
        FormObj = Activator.CreateInstance(formtype, param)

        'Cast it to a Form object to enable early binding and show the
form
        Dim Form1 As Form = CType(FormObj, Form)
        Form1.ShowDialog()
    End Sub
End Module



Mon, 05 Apr 2004 16:20:50 GMT  
 Reflection.Assembly.LoadFrom
How can you tell that the existing dll is always being downloaded? We are
using the same deployment scenario. The first pass through always seems
slower than the subsequent ones.


Hi

We are using Reflection.Assembly.LoadFrom to load our DLL's from a
HTTP-server.
Isn't this function supposed to download the DLL only if it's newer than
the version
in the download cache? As it is now, the DLL is downloaded everytime,
even when
another form from the same DLL is already visible.

Are we doing something wrong?

The code that loads the main form (the code that loads other forms look
the same, but
are spread over multiple functions, as they are called from menu click
events):

Module F4all
    Const url As String = "http://sql99/f4all/"
    Sub main()
        Dim dll As Reflection.Assembly
        Dim param(0) As Object
        dll = Reflection.Assembly.LoadFrom(url & "f4allmdi.dll") ', sec)

        'Get the Form from the assembly
        Dim formtype As Type = dll.GetType("F4AllMdi.frmMain")

        'Create an instance of the Form
        Dim FormObj As Object
        param(0) = url
        FormObj = Activator.CreateInstance(formtype, param)

        'Cast it to a Form object to enable early binding and show the
form
        Dim Form1 As Form = CType(FormObj, Form)
        Form1.ShowDialog()
    End Sub
End Module



Tue, 06 Apr 2004 06:51:48 GMT  
 Reflection.Assembly.LoadFrom


Quote:
> How can you tell that the existing dll is always being downloaded? We
are
> using the same deployment scenario. The first pass through always
seems
> slower than the subsequent ones.

While testing over a 33.6 modem, a specific form always takes ~1m 30s to
load,
even when another instance of the same form is already visible.

Quote:


> Hi

> We are using Reflection.Assembly.LoadFrom to load our DLL's from a
> HTTP-server.
> Isn't this function supposed to download the DLL only if it's newer
than
> the version
> in the download cache? As it is now, the DLL is downloaded everytime,
> even when
> another form from the same DLL is already visible.

> Are we doing something wrong?

> The code that loads the main form (the code that loads other forms
look
> the same, but
> are spread over multiple functions, as they are called from menu click
> events):

> Module F4all
>     Const url As String = "http://sql99/f4all/"
>     Sub main()
>         Dim dll As Reflection.Assembly
>         Dim param(0) As Object
>         dll = Reflection.Assembly.LoadFrom(url & "f4allmdi.dll") ',
sec)

>         'Get the Form from the assembly
>         Dim formtype As Type = dll.GetType("F4AllMdi.frmMain")

>         'Create an instance of the Form
>         Dim FormObj As Object
>         param(0) = url
>         FormObj = Activator.CreateInstance(formtype, param)

>         'Cast it to a Form object to enable early binding and show the
> form
>         Dim Form1 As Form = CType(FormObj, Form)
>         Form1.ShowDialog()
>     End Sub
> End Module



Tue, 06 Apr 2004 13:51:18 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Reflection assembly version recognition...

2. Trying to Dunamically Load Assembly via Reflection

3. Missing assembly when using reflection to call component method

4. Reflection.Assembly

5. Assembly and Global Assembly Cache

6. reating a dynamic assembly for Form and display Form created through Reflection.Emit Class and AssemblyBuilder Class

7. Reflection and Property Type Comparison

8. Getting the object name via reflection

9. Release a reference from System.Reflection

10. Reflection

11. How far can System.Reflection take you?

12. reflection of a private property WITH parameters?

 

 
Powered by phpBB® Forum Software