The type '…' has no constructors defined

前端 未结 6 586
自闭症患者
自闭症患者 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:12

    Also this error could be cause if you are compiling with Framework 4 or higher and embedding the Interop Types into your managed assembly. To get rid of this error you need to turn off (No embed) the Embedded Interop Types.

    Instructions to turn off embedding:

    1. On VS2010 Solution Explorer, right click on the Interop Reference that you are using.
    2. Select Properties and look for Embed Interop Types
    3. Change it from True to False

    You can read about Embedded Interop Types here.

    Pablo

提交回复
热议问题