Is there a way?
I need all types that implement a specific interface to have a parameterless constructor, can it be done?
I am developing the base code for other developers in my company to use in a specific project.
There's a proccess which will create instances of types (in different threads) that perform certain tasks, and I need those types to follow a specific contract (ergo, the interface).
The interface will be internal to the assembly
If you have a suggestion for this scenario without interfaces, I'll gladly take it into consideration...
You do not need a parameterless constructor for the Activator to instantiate your class. You can have a parameterized constructor and pass all the parameters from the Activator. Check out MSDN on this.
No you can't do that. Maybe for your situation a factory interface would be helpful? Something like:
For every implementation of Foo you create an instance of FooFactory that knows how to create it.
You can use type parameter constraint
I don't think so.
You also can't use an abstract class for this.