Results 1 to 4 of 4

Thread: LoadFrom() Hell

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2005
    Posts
    2

    LoadFrom() Hell

    Hi All, I have a .dll file that I have mapped to with a virtual directory so it can be referenced at (http://Localhost/WEBDEP/EX.dll). I than created a stub app that I based off of the "Death of the Browser doco" as follows:

    Try
    'Download the assembly from a web server over HTTP
    Dim sLocation As String
    sLocation = _
    "http://Localhost/WEBDEP/EX.dll"
    Dim formAsm As [Assembly] = [Assembly].LoadFrom(sLocation)
    'Get the Form from the assembly
    Dim formtype As Type = formAsm.GetType("EX.Form1")
    'Create an instance of the Form
    Dim FormObj As Object
    FormObj = Activator.CreateInstance(formtype)
    'Cast it to a Form object to enable early binding and show the form
    Dim Form1 As Form = CType(FormObj, Form)
    Form1.Show()
    Catch exc As Exception
    MsgBox(exc.ToString)
    End Try
    =================================

    When I run this I receive an error when it hits the following line:
    Dim formAsm As [Assembly] = [Assembly].LoadFrom(sLocation)

    The error is "File or assembly name EX.dll, or one of its dependencies, was not found."

    Has anyone came across this problem before? Or can anyone give me any help at all? I have been banging my head against this one for quite a few hours and any help would sooth this headache that I have got.

    Thanks in advance

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: LoadFrom() Hell

    New territory, but shouldn't you be working with a local copy of the DLL, instead of using it over http? I think that's the entire problem.

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2005
    Posts
    2

    Re: LoadFrom() Hell

    Im implementing internet deployment so therefore the dll must be accessed through the net.

  4. #4
    Fanatic Member LITHIA's Avatar
    Join Date
    Dec 2002
    Location
    UK, England
    Posts
    575

    Re: LoadFrom() Hell

    Maybe it's having a problem accessing the dll directly. Maybe you can try downloading it to the hard-disk first and then accessing it from there?

    I guess this is inefficient though, especially if the dll is quite large. (Although if it's external, you'll be still having to download it, technically, so there won't be any difference in speed).

    Hopefully someone else can help, but there's my suggestion if you can't do anything else.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width