简体   繁体   English

Glade找不到gui.glade

[英]Glade can't find gui.glade

I'm using in my code: 我在我的代码中使用:

Glade.XML gxml = new Glade.XML (null, "gui.glade", "PublicanCreators", null);

The gui.glade file is placed in the same directory as the Program.cs (which runs the code). gui.glade文件与Program.cs(运行代码)放置在同一目录中。

The compiling process has suceeded. 编译过程成功了。 But while running the exe i'm getting: 但是在运行exe时,我得到了:

Stacktrace: 堆栈跟踪:

at <0xffffffff> at (wrapper managed-to-native) Glade.XML.gtksharp_glade_xml_get_filename (intptr) at Glade.XML.get_Filename () at (wrapper runtime-invoke) .runtime_invoke_object__this__ (object,intptr,intptr,intptr) at <0xffffffff> at Glade.XML..ctor (System.Reflection.Assembly,string,string,string) at PublicanCreators.GladeApp..ctor (string[]) [0x00018] in /home/sascha/RiderProjects/PublicanCreators/PublicanCreators/Program.cs:40 at PublicanCreators.GladeApp.Main (string[]) [0x00002] in /home/sascha/RiderProjects/PublicanCreators/PublicanCreators/Program.cs:34 at (wrapper runtime-invoke) .runtime_invoke_void_object (object,intptr,intptr,intptr) 在<0xffffffff>在(包装本机管理)Glade.XML.gtksharp_glade_xml_get_filename(intptr)在Glade.XML.get_Filename()在(包装运行时调用).runtime_invoke_object__this__(object,intptr,intptr,intptffff)在<0xx >在/ home / sascha / RiderProjects / PublicanCreators / PublicanCreators / Program中的PublicanCreators.GladeApp..ctor(string [])[0x00018]的Glade.XML..ctor(System.Reflection.Assembly,string,string,string)中。 cs:40在/home/sascha/RiderProjects/PublicanCreators/PublicanCreators/Program.cs:34在PublichomeCreators.GladeApp.Main(string [])[0x00002]在(wrapper runtime-invoke).runtime_invoke_void_object(object,intptr,intptr, intptr)

What can i do? 我能做什么?

Looks like you need gui.glade in the bin folder, not the source folder. 看起来您需要在bin文件夹中而不是源文件夹中的gui.glade。 Make sure it is included in your project file and is copied on compile. 确保它包含在您的项目文件中,并在编译时复制。

It looks like the solution is to change the code to: 看来解决方案是将代码更改为:

Glade.XML gxml = new Glade.XML ("gui.glade", "PublicanCreators", null);

There it finds the file. 在那里找到文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM