title: Cannot declare a variable of static type and Cannot create an instance of the static class
body: <p>First apologize for my duplicate question for short time..</p>
  
  <p>again i have problem on use class in other place and my errors is:</p>
  
  <pre><code>Error 1 Cannot declare a variable of static type 'umEdition.Program'    
  Error 2 Cannot create an instance of the static class 'umEdition.Program'   
  </code></pre>
  
  <p>and my code is:</p>
  
  <pre><code>using DBNUpdater;
  using System;
  using System.IO;
  using System.Diagnostics;
  using System.Runtime.CompilerServices;
  using System.Threading;
  using System.Windows.Forms;
  using System.Reflection;
  
  
  namespace umEdition
  {
  internal static class Program
  {
      [CompilerGenerated]
      private static bool BackingField;
      private static bool openUpdater = false;
      private static ProgressDialog pdialog;
      private static bool updaterFinished = false;
  
      private static void _core_Completed(object sender, EventArgs e)
      {
          updaterFinished = true;
          Completed = true;
      }
  
      private static void _core_Failed(object sender, FailedEventArgs e)
      {
          MessageBox.Show(e.Exception.ToString(), "loader", MessageBoxButtons.OK, MessageBoxIcon.Hand);
          Completed = true;
          updaterFinished = false;
      }
  
      private static void _core_StatusChanged(object sender, StatusChangedEventArgs e)
      {
          if (e.StatusText == "Downloading")
          {
              if (pdialog != null)
              {
                  pdialog.Line1 = e.StatusText;
                  pdialog.Line2 = e.DetailedStatus + string.Format(" ({0}%)", Math.Round(e.ExactPercentage, 1));
                  pdialog.Line3 = " ";
                  pdialog.Value = (uint)(e.ExactPercentage * 10.0);
              }
              if (!Completed)
              {
                  openUpdater = true;
                  Completed = true;
              }
          }
      }
  
      [MTAThread]
      private static void Main1()
      {
          string[] strArray = new string[] { "a", "b", "c", "d", "e" };
          Random random = new Random();
          string str = strArray[random.Next(0, strArray.Length)];
          Completed = false;
  
          var icon = new NotifyIcon();
          icon.Icon = System.Drawing.Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location);
          icon.Text = "PlusGamer - starting";
          icon.Visible = true;
  
          Core core = new Core();
          core.CacheLocation = Environment.CurrentDirectory;
          core.WebCacheServer = string.Format("http://mysite.com/", str);
          core.LocalCacheServer = "";
          core.WantedCaches = new string[] { "anyfiles" };
          core.EnableUploading = false;
          core.StatusChanged += new EventHandler&lt;StatusChangedEventArgs&gt;(Program._core_StatusChanged);
          core.Failed += new EventHandler&lt;FailedEventArgs&gt;(Program._core_Failed);
          core.Completed += new EventHandler&lt;EventArgs&gt;(Program._core_Completed);
  
          core.Start();
  
          var time = DateTime.UtcNow;
          var shown = false;
  
          while (!Completed)
          {
              System.Threading.Thread.Sleep(1);
  
              var newTime = DateTime.UtcNow;
              var diff = newTime - time;
  
              if (diff.TotalMilliseconds &gt; 2000)
              {
                  if (!shown)
                  {
                      icon.ShowBalloonTip(2500, "any text ;)", ToolTipIcon.Info);
  
                      shown = true;
                  }
              }
          }
          if (openUpdater)
          {
              Completed = false;
              pdialog = new ProgressDialog(IntPtr.Zero);
              pdialog.Title = "loading";
              pdialog.Maximum = 0x3e8;
              pdialog.ShowDialog(new ProgressDialog.PROGDLG[1]);
          }
          while (!Completed)
          {
              Thread.Sleep(1);
              if ((pdialog != null) &amp;&amp; pdialog.HasUserCancelled)
              {
                  core.Kill();
                  return;
              }
          }
          if (updaterFinished)
          {
              if (!File.Exists("chrome.exe"))
              {
                  //MessageBox.Show("Cannot find iw4m.exe");
                  MessageBox.Show("OPSS!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  
  
                  return;
              }
  
              int promptValue = Prompt.ShowDialog("lol", "lol2");
  
          }
  
          icon.Visible = false;
          icon.Dispose();
  
      }
  
      public static class Prompt
      {
          public static int ShowDialog(string text, string caption)
          {
              Form prompt = new Form();
              prompt.Width = 500;
              prompt.Height = 100;
              prompt.Text = caption;
              Label textLabel = new Label() { Left = 50, Top = 20, Text = text };
              prompt.ShowDialog();
              return 1;
          }
      }
  
      public static bool Completed
      {
          [CompilerGenerated]
          get
          {
              return BackingField;
          }
          [CompilerGenerated]
          set
          {
              BackingField = value;
          }
      }
  }
  }
  </code></pre>
  
  <p>Then i try use class Program from the above code in here: </p>
  
  <pre><code> private void Window_Loaded(object sender, RoutedEventArgs e)
      {
  
          Program update = new Program();
  
      }
  </code></pre>
  
  <p>But i have error on it?!
  again thank you for help.</p>