title: Unhandled Exception: System.TypeLoadException when running on mono, compiled on .NET 4
body: <p>I have written a small app in C# which works no problem. Target Framework is .NET 4.</p>
  
  <p>When I run the app under linux - mono  , the app starts no problem.</p>
  
  <p>However I seem to be having a problem with Threading under mono.</p>
  
  <p>Code below:</p>
  
  <pre><code> try
                  {
                      Thread oThread = new Thread(new ParameterizedThreadStart(this.SendSms));
                      oThread.IsBackground = true;
                      oThread.Start(_data);
  
                      while (!oThread.IsAlive)
                      {
                          Console.WriteLine("Sleeping...");
                          Thread.Sleep(1);
                      }
  
                  }
                  catch (TypeLoadException tlex)
                  {
                      Console.WriteLine("TypeLoadException: " + tlex.Message);
  
                  }
                  catch (Exception ex)
                  {
                      Console.WriteLine(ex.Message);
                  }
  </code></pre>
  
  <p>It doesn't seem to get to the SendSms method, but instead throws the following error:</p>
  
  <pre><code>Unhandled Exception: system.TypeLoadException: A type load exception has occurred. at System.Threading.Thread.StartUnsafe () [0x00000] in &lt;filename unknown&gt;:0
  [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: A type load exception has occurred. at System.Threading.Thread.StartUnsafe () [0x00000] in &lt;filename unknown&gt;:0
  </code></pre>
  
  <p>Now I am new to Mono so don't know firstly why this unhandled exception is occuring as the code for the parameterized thread comes from 'http://www.mono-project.com/ThreadsBeginnersGuide'. And secondly, why is it unhandled when i put in the
      catch (TypeLoadException tlex)</p>
  
  <p>Please assist.</p>
  
  <p>Thanks</p>
  
  <p>Neill</p>