title: Error "Does not contain a static "Main" Method suitable for an entry point
body: <p>I got this Error when I try to compile a sourcecode with CodeDom</p>
  
  <blockquote>
    <p>Does not contain a static "Main" Method suitable for an entry point!</p>
  </blockquote>
  
  <p>I already googled it and read other answers here, but I dont know how to fix it.</p>
  
  <p>Can someone please help me?
  Here is my source code : 
  <a href="http://picz.to/image/ao5n" rel="nofollow">http://picz.to/image/ao5n</a></p>
  
  <pre><code>    ^        private void button2_Click(object sender, EventArgs e)
      {
          SaveFileDialog d = new SaveFileDialog();
          d.Filter = "Executable (*.exe)|*.exe";
          if (d.ShowDialog() == DialogResult.OK)
          {
              string source = Properties.Resources.source;
              CompilerParameters param = new CompilerParameters();
              param.CompilerOptions += "/target:winexe" + " " + "/win32icon:" + "\"" + textBox1.Text + "\"";
              param.GenerateExecutable = true;
              param.ReferencedAssemblies.Add("System.Windows.Forms.dll");
              param.ReferencedAssemblies.Add("System.dll");
              param.OutputAssembly = d.FileName;
  
              StringBuilder Temp = new StringBuilder();
              String InputCode = String.Empty;
              InputCode = "MessageBox.Show((1 + 2 + 3).ToString());";
              Temp.AppendLine(@"using System;");
              Temp.AppendLine(@"using System.Windows.Forms;");
              Temp.AppendLine(@"namespace RunTimeCompiler{");
              Temp.AppendLine(@"static void Main(string[] args){");
  
              Temp.AppendLine(@"public class Test{");
              Temp.AppendLine(@"public void Ergebnis(){");
  
              Temp.AppendLine(InputCode);
              Temp.AppendLine(@"}}}}");
              CompilerResults result = new CSharpCodeProvider().CompileAssemblyFromSource(param, Temp.ToString());
              if (result.Errors.Count &gt; 0) foreach (CompilerError err in result.Errors) MessageBox.Show(err.ToString());
              else MessageBox.Show("Done.");
          }
      }
  </code></pre>