I keep getting an error called "TypeIntializationException was unhandled" and I don't know how
<p>this is my program.cs file (This is all done on VS 2010 in C#)      </p>

<pre><code>    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Windows.Forms;

    namespace GameLoop
    {
     static class Program
        {
            static FastLoop _fastLoop = new FastLoop(GameLoop);
            /// &lt;summary&gt;
            /// The main entry point for the application.
         /// &lt;/summary&gt;
            [STAThread]
         static void Main()
         {
               Application.EnableVisualStyles();
             Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new Form1());
         }
         static void GameLoop(double elapsedTime)
          {
                //GameCode goes here
             //Get Input
             //Process
            //Render
                System.Console.WriteLine("loop");
         }
      }
    }
</code></pre>

<p>this one is my FastLoop.cs file (This is all done on VS 2010 in C#)      </p>

<pre><code>    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.Runtime.InteropServices;

    namespace GameLoop
    {
        [StructLayout(LayoutKind.Sequential)]
        public struct Message
        {
            public IntPtr hWnd;
            public Int32 msg;
            public IntPtr wParam;
            public IntPtr lParam;
            public uint time;
            public System.Drawing.Point p;
        }

        public class FastLoop
        {
            [System.Security.SuppressUnmanagedCodeSecurity]
            [DllImport("User32.dll", CharSet = CharSet.Auto)]
            public static extern bool PeekMessage(
                out Message msg,
                IntPtr hWnd,
                uint messageFilterMin,
                uint messageFilterMax,
                uint flags);

            PreciseTimer _timer = new PreciseTimer();
            public delegate void LoopCallback(double elapsedTime);
            LoopCallback _callback;

            public FastLoop(LoopCallback callback)
            {
                _callback = callback;
                Application.Idle += new EventHandler(OnApplicationEnterIdle);
            }
            void OnApplicationEnterIdle(object sender, EventArgs e)
            {
                while (IsAppStillIdle())
                {
                    _callback(_timer.GetElapsedTime());
                }
            }
            private bool IsAppStillIdle()
            {
                Message msg;
                return !PeekMessage(out msg, IntPtr.Zero, 0, 0, 0);

            }
        }
    }
</code></pre>

<p>this one is my PerciseTimer.cs file (This is all done on VS 2010 in C#)      </p>

<pre><code>    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Runtime.InteropServices;

    namespace GameLoop
    {
        public class PreciseTimer
        {
            [System.Security.SuppressUnmanagedCodeSecurity]
            [DllImport("kernal32")]
            private static extern bool QueryPerformanceFrequency(ref long PerformanceFrequency);

             [System.Security.SuppressUnmanagedCodeSecurity]
            [DllImport("kernal32")]
        private static extern bool QueryPerformanceCounter(ref long PerformanceCount);

            long _ticksPerSecond = 0;
            long _previousElapsedTime = 0;

            public PreciseTimer()
            {
                QueryPerformanceFrequency(ref _ticksPerSecond);
                GetElapsedTime();//get rid if first rubbish result
            }
            public double GetElapsedTime()
            {
                long time = 0;
                QueryPerformanceCounter (ref time);
                double elapsedTime = (double)(time -_previousElapsedTime)/(double)_ticksPerSecond;

                _previousElapsedTime = time;
                return elapsedTime;
        }
    }
    }
</code></pre>

<p>this on is my form1.cs file (This is all done on VS 2010 in C#)      </p>

<pre><code>    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;

    namespace GameLoop
    {
        public partial class Form1 : Form
        {
            bool _fullscreen = true;
            public Form1()
            {
                InitializeComponent();
                simpleOpenGlControl1.InitializeContexts();
                if (_fullscreen)
                {
                    FormBorderStyle = FormBorderStyle.None;
                    WindowState = FormWindowState.Maximized;

                }
            }

            private void Form1_Load(object sender, EventArgs e)
            {

            }

            private void simpleOpenGlControl1_Load(object sender, EventArgs e)
            {

            }
        }
    }
</code></pre>
