c# - The type '...' has no constructors defined -
i'm noticing compiler error the type '...' has no constructors defined generated when erroneously attempt instantiate particlar class.
it lead me wonder how go writing own class precipitate message when attempted instantiate it.
so code below, need myclass
?
namespace mynamespace { class program { static void main(string[] args) { myclass mc = new myclass(); } } class myclass { myclass() { } } }
this error (cs0143) occurs if class defines internal constructor , try instantiate assembly.
public class myclass { internal myclass() { } }
Comments
Post a Comment