Assembly.CreateInstance returns null?

  • Thread starter Thread starter Rick Lemons
  • Start date Start date
R

Rick Lemons

Can anyone tell me what's wrong with the following CreateInstance? It
returns null. The Assembly.LoadFrom works OK.

Assembly assembly = Assembly.LoadFrom("MyDll.dll");
object functionObject = assembly.CreateInstance("MyNamespace.MyClass");

MyDll looks like:

namespace MyNamespace
{
public class MyClass
{
public MyClass()
{
}
}
}



Thank you.
 
If works fine on my side. I'd suggest to use assembly.GetExportedTypes to
list the exported types of MyDll.dll.

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
 
Back
Top