The MissingMethodException tells you what method is missing with its Message property. Giving it a chance to tell you is however often overlooked by programmers. You must write an event handler for the AppDomain.UnhandledException event and display or log the e.UnhandledException object.
Do note that your program crashes very early on a jitter crash. The jitter runs before code is executed. That makes it likely that you are looking at the wrong code for the problem. It isn't the Main() method that caused the crash, most likely it is the form that you create in your Main method. Albeit that this is a guess, you forgot to post the code in your Main() method. To be on the safe side, a good practice is to separate the event registration from the code with the cooties, best done by suppressing inlining. Modify the Program.cs source code and make it look similar to this:
using System.Runtime.CompilerServices;
...
[STAThread]
static void Main() {
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
RealMain();
}
[MethodImpl(MethodImplOptions.NoInlining)]
static void RealMain() {
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
// Your code here
//...
}
static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) {
var ex = (Exception)e.ExceptionObject;
MessageBox.Show(ex.ToString(), "Unexpected error");
Environment.Exit(System.Runtime.InteropServices.Marshal.GetHRForException(ex));
}
You are likely to get the name back of one of your own methods. Do however not discount the possibility that you'll see a framework method. There are four distinct versions of .NET 4 and you cannot guess which one is on the user's machine. If that's the case then you made a mistake when you created the project, you added assembly references from the c:\windows\microsoft.net subdirectory instead of c:\program files\reference assemblies. Which will let you use a method that isn't available in an early version of .NET 4.