I haven't done this in a long time (I think it was .NET 1.0, or maybe the beta), but at the time I had to add a handler to AppDomain.CurrentDomain.AssemblyResolve to help with type resolution.
Trying that might help get you up and running, but it's probably not the 'right' answer. Good luck, Geoff On Wed, Jun 25, 2008 at 6:32 PM, Mike Andrews <[EMAIL PROTECTED]> wrote: > I need some help with dynamic assembly loading. > > I need to load a single assembly and its dependent assemblies (and theirs > too if required). I already have a method that will get the assembly and > dependent assemblies. > > I have this section of code (this is test only): > > foreach (var item in allAssemblies) { > var assm = item.GetAssembly(); > } > > foreach (var item in allAssemblies) { > try { > System.Reflection.Assembly ab = item.GetAssembly(); > Type[] types = item.GetAssembly().GetTypes(); > } catch (System.Reflection.ReflectionTypeLoadException ex) { > > } > } > > The GetAssembly() method above essentially does this: > > return System.Reflection.Assembly.Load(data, null, > this.GetType().Assembly.Evidence); > > The first assembly I come to is the primary assembly. It has the type I > want to use. The subsequent assemblies are the assemblies upon which the > primary assembly depends. > However, even though I've loaded all the assemblies, I get the > ReflectionTypeLoadException when I try to query the Types in the primary > assembly by using the GetTypes() method. > > Any suggestions on how I can accomplish this? > > Thanks, > Mike > > =================================== > This list is hosted by DevelopMentor(R) http://www.develop.com > > View archives and manage your subscription(s) at > http://discuss.develop.com > =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com