What happens when you call Assembly.CreateInstance more than once for the same assembly?
In an开发者_JAVA百科 app I am working on, I use reflection to dynamically load animation assemblies (and create instances from them). However, when I am done with the animation, I dispose of the wrapper on the animation and forget about it . . . which works until I need the animation again.
Creating the animation calls Assembly.CreateInstance(AnimationUnit.TypeName)
to dynamically create an instance from the animation assembly, since each assembly is a uniquely named dll file. Is the Silverlight Runtime smart enough to only load the assembly once, even if I make this call multiple times?
Assembly.CreateInstance
doesn't create an instance of the assembly - it creates an instance of a type within the given assembly.
精彩评论