Assembly.LoadWithPartialName replacement??
i am loading an assembly with reflection through a partial name ... in this case "system"
vb Code:
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
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?
Re: Assembly.LoadWithPartialName replacement??
System IS the "Filename"
When i go:
vb Code:
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