Results 1 to 3 of 3

Thread: Assembly.LoadWithPartialName replacement??

  1. #1

    Thread Starter
    PowerPoster i00's Avatar
    Join Date
    Mar 2002
    Location
    1/2 way accross the galaxy.. and then some
    Posts
    2,390

    Assembly.LoadWithPartialName replacement??

    i am loading an assembly with reflection through a partial name ... in this case "system"
    vb Code:
    1. Assembly.LoadWithPartialName(Filename)
    works in this case to load the assembly but produces the following:
    Code:
    Public Shared Function LoadWithPartialName(partialName As String) As System.Reflection.Assembly' is obsolete: 'This method has been deprecated. Please use Assembly.Load() instead...
    But when I use load i get the error:
    Code:
    Could not load file or assembly 'system' or one of its dependencies. The system cannot find the file specified.
    Is it not quite stupid of M$ to recommend using another function to replace an existing function if it does not work the same way?

    I guess i am asking if there is another way to do this, or atleast a way to hide the warning for this appearing in the warning window - as i like no warnings

    Thanks
    Kris

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Assembly.LoadWithPartialName replacement??

    What exactly is the contents of your "Filename" variable?

    This works fine for me:

    Code:
    Dim mySystemAssembly = System.Reflection.Assembly.Load("System")
    Although maybe it is just for example, but what scenario would you need to dynamically load the system assembly when its already referenced by your project?

  3. #3

    Thread Starter
    PowerPoster i00's Avatar
    Join Date
    Mar 2002
    Location
    1/2 way accross the galaxy.. and then some
    Posts
    2,390

    Re: Assembly.LoadWithPartialName replacement??

    System IS the "Filename"

    When i go:
    vb Code:
    1. Dim mySystemAssembly = System.Reflection.Assembly.Load("System")
    i get:
    Code:
    Could not load file or assembly 'system' or one of its dependencies. The system cannot find the file specified.
    It works if the system reference is copied locally ... but i don't really want to do that

    Thanks
    Kris

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