Mehdiway
Mehdiway

Reputation: 10646

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;
    }
}

Upvotes: 5

Views: 1565

Answers (1)

vidstige
vidstige

Reputation: 13079

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.

Upvotes: 6

Related Questions