nay
12/15/2002 7:53:00 PM
Hi
Thank you for relate my problem, I haven't send it as a
direct reply because few days has passed.
My elaboration(You answer is at the buttom):
- The full path is an absolute path to the dll that was
draged to the gac through windows explorer
- By say "within same dll as the classes it try to
instanciate at run time" I mean that In my dll I have 5
classes and one of them is the class that try to create
instances of the other 4 classes(The only one who dosen't
require transaction).
-The code:
Dim assem As System.Reflection.Assembly
Dim classType As Type
Dim obj As ServicedComponent
assem = System.Reflection.Assembly.LoadFrom
("C:\Project.dll")
classType = Type.GetType("Project.class")
obj = Activator.CreateInstance(classType)
2 kinds of exception message are thrown from The last
> line: ArgumentException, and the
> message: " Err desc: Type must be a type provided by the
> runtime, not a TypeDelegator, etc.
> Parameter name: type"
> or invalidCastException and the following wierd
> message: "Can not cast from Project.ClassName to
> Project.ClassName type"
Thanks again, Nay!
You wrote me
Can I get a little more information?
- What is the full path of the dll? Specifically, is that
the path to the
dll in the GAC?
- I don't know what you mean by "within same dll as the
classes it try to
instanciate at run time". Can you elaborate?
- Can you provide a very simple repro? I can't cause the
failure that you
are reporting, but I'm probably not doing exactly what you
are trying to do.