title: AppDomain.DoCallBack returns System.Runtime.Serialization.SerializationException
body: <p>I keep getting
      <code>An exception of type 'System.Runtime.Serialization.SerializationException'
      occurred in IRCBot.exe but was not handled in user code</code>
  from AppDomain.DoCallBack</p>
  
  <p>My code is </p>
  
  <pre><code>            object result = null;
          try {
              Console.WriteLine("Attempting to run in sandbox");
              sandbox.DoCallBack(() =&gt;
              {
                  Console.WriteLine("Creating thread");
                  try
                  {
                      var scriptThread = new Thread(() =&gt;
                      {
                          try
                          {
                              Console.WriteLine("Trying");
                              result = CSharpScript.RunAsync(code).ReturnValue.Result;
                          }
                          catch (Exception ex)
                          {
                              result = ex.Message;
                          }
                      });
                      scriptThread.Start();
  
                      if (!scriptThread.Join(6000))
                      {
                          scriptThread.Abort();
                          AppDomain.Unload(sandbox);
                      }
                  }
                  catch (Exception ex)
                  {
                      result = ex.ToString();
                  }
              });
          }
          catch (Exception e)
          {
              result = e.ToString();
          }
  </code></pre>
  
  <p>Sorry if this question sounded brief, but I don't really know what more to say. I have traced down the source of the exception to DoCallBack. Thank you in advance.</p>