System.Threading is actually in mscorlib, so you&#39;d have to AddReference(&quot;mscorlib&quot;) as well. Alternatively, you can load both mscorlib and System.dll in your hosting code by saying something like this:<br><br>
ScriptDomainManager.CurrentManager.LoadAssembly(typeof(string).Assembly); //mscorlib.dll<br>ScriptDomainManager.CurrentManager.LoadAssembly(typeof(System.Diagnostics.Debug).Assembly); //System.dll<br><br>I think we&#39;ve changed this in 2.6A1 so that these are always loaded by default in hosting scenarios.<br>
<br><div class="gmail_quote">On Wed, May 6, 2009 at 8:51 PM, Douglas Blank <span dir="ltr">&lt;<a href="mailto:dblank@brynmawr.edu">dblank@brynmawr.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I&#39;m working on a couple of variations of an IronPython Shell, and I have<br>
the following issue. When I import some DLLs interactively, I&#39;m not seeing<br>
all of the available objects. For example, in my shells I try:<br>
<br>
&gt;&gt;&gt; import clr<br>
&gt;&gt;&gt; clr.AddReference(&quot;System&quot;)<br>
&gt;&gt;&gt; from System.Threading import Thread<br>
<br>
and I get the error that &#39;Cannot import name Thread&#39;. In fact, if I:<br>
<br>
&gt;&gt;&gt; import System.Threading<br>
&gt;&gt;&gt; dir(System.Threading)<br>
<br>
I get:<br>
<br>
[&#39;Semaphore&#39;, &#39;SemaphoreFullException&#39;, &#39;ThreadExceptionEventArgs&#39;,<br>
&#39;ThreadExceptionEventHandler&#39;]<br>
<br>
However, using the ipy.exe console, I correctly get:<br>
<br>
&gt;&gt;&gt; import System.Threading<br>
&gt;&gt;&gt; dir(System.Threading)<br>
[&#39;AbandonedMutexException&#39;, &#39;ApartmentState&#39;, &#39;AsyncFlowControl&#39;,<br>
&#39;AutoResetEvent&#39;, &#39;CompressedStack&#39;, &#39;ContextCallback&#39;, &#39;EventResetMode&#39;,<br>
&#39;EventWaitHandle&#39;, &#39;ExecutionContext&#39;, &#39;HostExecutionContext&#39;,<br>
&#39;HostExecutionContextManager&#39;, &#39;IOCompletionCallback&#39;, &#39;Interlocked&#39;,<br>
&#39;LockCookie&#39;, &#39;ManualResetEvent&#39;, &#39;Monitor&#39;, &#39;Mutex&#39;, &#39;NativeOverlapped&#39;,<br>
&#39;Overlapped&#39;, &#39;ParameterizedThreadStart&#39;, &#39;ReaderWriterLock&#39;,<br>
&#39;RegisteredWaitHandle&#39;, &#39;Semaphore&#39;, &#39;SemaphoreFullException&#39;, &#39;SendOrP<br>
ostCallback&#39;, &#39;SynchronizationContext&#39;, &#39;SynchronizationLockException&#39;,<br>
&#39;Thread&#39;, &#39;ThreadAbortException&#39;, &#39;ThreadExceptionEventArgs&#39;,<br>
&#39;ThreadExceptionEventHandler&#39;, &#39;ThreadInterruptedException&#39;, &#39;ThreadPool&#39;,<br>
&#39;ThreadPriority&#39;, &#39;ThreadStart&#39;, &#39;ThreadStartException&#39;, &#39;ThreadState&#39;,<br>
&#39;ThreadStateException&#39;, &#39;Timeout&#39;, &#39;Timer&#39;, &#39;TimerCallback&#39;,<br>
&#39;WaitCallback&#39;, &#39;WaitHandle&#39;, &#39;WaitHandleCannotBeOpenedException&#39;,<br>
&#39;WaitOrTimerCallback&#39;]<br>
<br>
I feel I must be doing something fundamentally wrong... anyone have a<br>
guess as to what that might be? Thanks for any ideas!<br>
<br>
-Doug<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a><br>
<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
</blockquote></div><br>