X does not contain a definition for Y
<p>Question has been answered by <strong><em>csharpler</em></strong>. I had no idea I created two of the same classes within each other (in the MenuMaker class)....</p>

<p>x</p>

<p>x</p>

<p>x</p>

<p>Here is the code sample I'm having trouble with:</p>

<pre><code>namespace MeatMenuProgram
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();

            MenuMaker menu = new MenuMaker() { Randomizer = new Random() };
            label1.Text = menu.GetMenuItem();
            label2.Text = menu.GetMenuItem();
            label3.Text = menu.GetMenuItem();
            label4.Text = menu.GetMenuItem();
            label5.Text = menu.GetMenuItem();
            label6.Text = menu.GetMenuItem();
        }
    }
}
</code></pre>

<p>I made a <code>MenuMaker</code> class:</p>

<pre><code>namespace MeatMenuProgram
{
    class MenuMaker
    {
        class MenuMaker {

            public Random Randomizer;

            string[] Meats = { "Roast beef", "Salami", "Turkey", "Ham", "Pastrami" };

            string[] Condiments = { "yellow mustard", "brown mustard","honey mustard", "mayo", "relish", "french dressing" };

            string[] Breads = { "rye", "white", "wheat", "pumpernickel","italian bread", "a roll" };

                public string GetMenuItem() {
                    string randomMeat = Meats[Randomizer.Next(Meats.Length)];

                    string randomCondiment = Condiments[Randomizer.Next(Condiments.Length)];

                    string randomBread = Breads[Randomizer.Next(Breads.Length)];

                    return randomMeat + " with " + randomCondiment + " on " + randomBread;

                }
            }
        }
    }
</code></pre>

<p>but it does not compile. The error log:</p>

<blockquote>
  <p>Error  1   'MeatMenuProgram.MenuMaker' does not contain a definition for 'Randomizer'</p>
  
  <p>Error  2   'MeatMenuProgram.MenuMaker' does not contain a definition for 'GetMenuItem' and no extension method 'GetMenuItem' accepting a first argument of type 'MeatMenuProgram.MenuMaker' could be found (are you missing a using directive or an assembly reference?)   </p>
</blockquote>
