我使用以下内容在应用中显示GTK文件选择器对话框,否则不会将GTK用于其他任何内容。
Gtk.FileChooserDialog fc =
new Gtk.FileChooserDialog(openParams.Title,
null,
FileChooserAction.Open,
"Cancel", ResponseType.Cancel,
"Open", ResponseType.Accept);
这基本上直接来自http://docs.go-mono.com/index.aspx?link=T%3aGtk.FileChooserDialog的示例。使用gtk-sharp 2.0可以正常工作,但是当我切换到gtk-sharp 3.0时,我得到了这个:
(mono:30587): GLib-GObject-WARNING **: cannot register existing type 'GtkWidget'
(mono:30587): GLib-GObject-WARNING **: cannot add class private field to invalid type '<invalid>'
(mono:30587): GLib-GObject-WARNING **: cannot add private field to invalid (non-instantiatable) type '<invalid>'
(mono:30587): GLib-GObject-CRITICAL **: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed
(mono:30587): GLib-GObject-WARNING **: cannot register existing type 'GtkBuildable'
(mono:30587): GLib-GObject-CRITICAL **: g_type_interface_add_prerequisite: assertion 'G_TYPE_IS_INTERFACE (interface_type)' failed
(mono:30587): GLib-CRITICAL **: g_once_init_leave: assertion 'result != 0' failed
(mono:30587): GLib-GObject-CRITICAL **: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed
(mono:30587): GLib-GObject-CRITICAL **: g_type_register_static: assertion 'parent_type > 0' failed
(mono:30587): GLib-GObject-WARNING **: cannot add private field to invalid (non-instantiatable) type '<invalid>'
我所做的搜索表明&#34;无法注册现有类型&#34;混合库版本时会发生一些事情。我确保我的程序集引用指向gtk及其所有相关库(atk,gio,glib)的3.0版本,但它仍然在发生。我怎么能弄清楚什么是错的?