My class has no default parameterless constructor. It has such a constructor instead:
public Section(string fileName) {...}
I am to create an instance of my class inside of some AppDomain
. If my class had a default constructor, then I would do it like this:
AppDomain domain = AppDomain.CreateDomain("ACAD-0001:409");
ISection section = (ISection)domain.CreateInstanceAndUnwrap(
typeof(Section).Assembly.FullName, typeof(Section).FullName);
But there is no default constructor. How can I transfer the parameters of my constructor?
I expected it to work something like this:
string cuiFile = "...";
ISection section = (ISection)domain.CreateInstanceAndUnwrap(
typeof(Section).Assembly.FullName,
typeof(Section).FullName,
new object[] { cuiFile });
But this doesn't work.