Example:
class Program
{
static void Main(string[] args)
{
var myClass = Activator.CreateInstance(typeof(MyClass));
}
}
It is not that impossible. you've to tell it is not a public.
var myClass = Activator.CreateInstance(typeof(MyClass), true);//say nonpublic
The constructor inside your MyClass is Internal try to change to public
public class MyClass
{
public MyClass()
{
}
}
or
Pass true to CreateInstance
var myClass = Activator.CreateInstance(typeof(MyClass),true );