It needs to run in a STA thread:

   - http://msdn.microsoft.com/en-us/library/ms743714.aspx (*"The
   STAThreadAttribute attribute is applied to the Main method to indicate that
   the main UI thread for the WPF application is an STA thread, which is
   required for WPF applications."*)
   -
   http://stackoverflow.com/questions/1293402/why-does-wpf-require-a-stathread-attribute-to-be-applied-to-the-main-method
   - http://blogs.msdn.com/b/jfoscoding/archive/2005/04/07/406341.aspx


On Tue, Mar 12, 2013 at 1:49 AM, Glenn Block <notifications@github.com>wrote:

> In src/ScriptCs.Core/Wrappers/SessionWrapper.cs:
>
> > @@ -29,7 +34,14 @@ public Session WrappedSession
> >
> >          public object Execute(string code)
> >          {
> > -            return _session.Execute(code);
> > +            object result = null;
> > +
> > +            var thread = new Thread(() => result = _session.Execute(code));
>
> Why do you need to do this? It needs to run in it's own thread?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/scriptcs/scriptcs/pull/94/files#r3329819>
> .
>