The type '…' has no constructors defined

前端 未结 6 588
自闭症患者
自闭症患者 2020-11-27 06:07

I\'m noticing the compiler error The type \'...\' has no constructors defined generated when I erroneously attempt to instantiate a particlar class.

6条回答
  •  一个人的身影
    2020-11-27 06:23

    This error (CS0143) occurs if the class only defines an internal constructor and you try to instantiate it from another assembly.

    public class MyClass
    {
        internal MyClass()
        {
        }
    }
    

提交回复
热议问题