Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xamarin Monodevelop - Error CS0103

I just installed Xamarin Monodevelop on Mac OSX, I created a GTK# project where I have a very basic Window that I haven't even touched. This is the error it gives me on Build();

Error CS0103: The name 'Build' does not exist in the current context

using System;
using Gtk;

public partial class MainWindow: Gtk.Window
{
    public MainWindow () : base (Gtk.WindowType.Toplevel)
    {
        Build ();
    }

    protected void OnDeleteEvent (object sender, DeleteEventArgs a)
    {
        Application.Quit ();
        a.RetVal = true;
    }
}
like image 837
Mehdiway Avatar asked Nov 12 '14 23:11

Mehdiway


1 Answers

The Build method is created by the Stetic UI builder, akin to the InitializeComponents of the Visual Studio UI builder.

There seems to be a bug in Xamarin Studio (I'm using 5.5.4.15) where the Build method is not generated unless you add a widget to the Window. Try adding a VBox or another container and then rebuilding.

like image 126
vidstige Avatar answered Oct 16 '22 23:10

vidstige