I want to inherit a class from another class, marked as abstract, that not have any constructor defined.
This is my code:
// In one assembly (TheMess
You probably have an internal constructor (not shown in the code that you posted) and are trying to instantiate the class with the internal constructor from a different assembly.
(The default constructor for a base class is automatically called from a derived class if you don't explicitly specify a base class constructor to call, so it might not be obvious to you that the base class constructor is being called.)
For example, if one assembly contains this class (inside namespace ClassLibrary1
):
public class Base
{
internal Base()
{
}
}
And a DIFFERENT assembly does this:
class Derived: Base
{
public Derived()
{
}
}
You will see the following compile error:
The type 'ClassLibrary1.Base' has no constructors defined