I am having the problems mentioned in this article when using
Assembly.LoadFrom():
http://blogs.msdn.com/suzcook/archive/2004/06/02/debugging-an-invalidcas
texception.aspx
My question is, how can I change my code to use Assembly.Load(), to
avoid these problems, when I only have the file path for the assembly? I
am running .NET 1.1.
If I understand correctly, the problem is that you are loading the
assembly twice, but from different paths. Switching to Assembly.Load()
won't help there much, I guess, you should probably investigate why
you are loading the assembly twice and remove that problem.
Anyway, to use Assembly.Load instead of Assembly.LoadFrom, the
assembly must either be in the GAC or in the application directory.
Therefore, I guess it would work to just copy the files to the
application directory and then use Assembly.Load _if_ your application
has the necessary rights to write to the application directory.
Fabian
===================================
This list is hosted by DevelopMentorĀ® http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com