[Mono-list] [Problem] Unhandled Exception

Rodolfo Campero rodolfo.campero at gmail.com
Fri Jul 15 09:39:05 EDT 2005


Hi,

On 7/15/05, 頌凱 <huki.tw at gmail.com> wrote:
>  when i remove image1.Pixbuf that line~~~~
>  can't see errors
>  please help me~~~~
>  
>  my code:
>  /*
>   *  date: 2005/07/15
>   *  author:huki (SongKai Huang)
>   *  mail:huki.tw at gmail.com
>   *  filename:test1.cs
>   */
>  using Gtk;
>  using Glade;
>  using GtkSharp;
>  using System.Reflection;
>  
>  public class test1
>  {
>      [Widget] Image image1;
>      [Widget] Fixed fixed1;
>      
>      public test1 ()
>      {
>          Application.Init();
>          
>          Glade.XML gxml = new Glade.XML ("./test1.glade", "window1", null);
>          gxml.Autoconnect (this);
>          image1.Pixbuf = new Gdk.Pixbuf (null, "icon.png");
>  
>          Application.Run();
>      }
>      
>      public static void Main (string [] args)
>      {
>          new test1();
>      }
>  
>      public void on_window1_delete_event (object o, DeleteEventArgs args)
>      {
>          Application.Quit ();
>      }
>  }
>  
>  
>  error:
>  
>  [huki at nb-huki ~/test1]$ mcs test1.cs  -pkg:glade-sharp  -pkg:gtk-sharp
>  test1.cs(15) warning CS0169: The private field 'test1.fixed1' is never used
>  Compilation succeeded - 1 warning(s)
>  [huki at nb-huki ~/test1]$ mono test1.exe
>  
>  Unhandled Exception: System.ArgumentException: resource must be a valid
> resource name of 'assembly'.
>  in <0x00094> Gdk.Pixbuf:.ctor (System.Reflection.Assembly assembly,
> System.String resource)
>  in <0x00065> test1:.ctor ()
>  in <0x00016> test1:Main (System.String[] args)

Try building with:
mcs -pkg:glade-sharp -pkg:gtk-sharp -resource:icon.png test1.cs

Regards,
Rodolfo


More information about the Mono-list mailing list