C#.NET - Type.GetType(“System.Windows.Forms.Form”) returns null

后端 未结 3 1747
Happy的楠姐
Happy的楠姐 2021-01-28 10:42

I have a snippet of code in my application (which references System.Windows.Forms) which attempts to resolve type information for a Form class like so:

3条回答
  •  执笔经年
    2021-01-28 11:09

    You need to use assembly-qualified name of the type

    Type tForm = Type.GetType("System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089");
    

提交回复
热议问题