<div dir="ltr">I get the same problem.<br><br>Another symptom is that &quot;import System&quot; fails if you don&#39;t AddReference first. never needed to do that for IPy 1.1 and don&#39;t need to either when running ipy 2.0.<br>
<br>It fails with my hosting code, and also reproduces with the &quot;hello world&quot; hosting sample:<br><a href="http://blogs.msdn.com/seshadripv/archive/2008/09/11/dlr-hosting-sample-simple-dlr-host-using-the-new-app-config-based-scriptruntime-creation.aspx">http://blogs.msdn.com/seshadripv/archive/2008/09/11/dlr-hosting-sample-simple-dlr-host-using-the-new-app-config-based-scriptruntime-creation.aspx</a><br>

<br>The only changes I made to the sample were<br>1) delete ruby configuration from App.config and the line of code that builds a ruby engine (I don&#39;t have the assemblies for ruby)<br>2) change the line defining the source code to:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ScriptSource source = pyEng.CreateScriptSourceFromString(@&quot;import System&quot;, SourceCodeKind.Statements);<br>3) remove the code that gets the &quot;output&quot; variable from pyEng (since we don&#39;t produce it)<br>
<br>like I said, this fails with &quot;No module named System&quot;.<br>If you add a clr.AddReference(&quot;System&quot;), then import works, but dir() seems to only show namespaces and not types, so import System.DateTime will fail.<br>
<br>I&#39;m now looking at sources for IronPythonConsole to see what the difference is, but if someone knows what I&#39;m doing wrong, please tell...<br><br>thanks<br>Ronnie<br><br><div class="gmail_quote">On Sun, Sep 21, 2008 at 8:31 AM, Serge R <span dir="ltr">&lt;<a href="mailto:deus.verus@gmail.com">deus.verus@gmail.com</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 am migrating from 1.1 and have been unable to import System.Math class. I took a look at what&#39;s actually been imported<br>
<br>clr.AddReference(&quot;System&quot;)<br>import System<br>print dir(System)<br><br>On IP2 I got a small list that didn&#39;t contain Math or many other classes. Am I referencing something wrong?<br>
<br>IP2 List:<br>[&#39;CodeDom&#39;, &#39;Collections&#39;, &#39;ComponentModel&#39;, &#39;Configuration&#39;, &#39;Diagnostics&#39;, &#39;FileStyleUriParser&#39;, &#39;FtpStyleUriParser&#39;, &#39;GenericUriParser&#39;, &#39;GenericUriParserOptions&#39;, &#39;GopherStyleUriParser&#39;, &#39;HttpStyleUriParser&#39;, &#39;IO&#39;, &#39;LdapStyleUriParser&#39;, &#39;Media&#39;, &#39;Net&#39;, &#39;NetPipeStyleUriParser&#39;, &#39;NetTcpStyleUriParser&#39;, &#39;NewsStyleUriParser&#39;, &#39;Runtime&#39;, &#39;Security&#39;, &#39;Text&#39;, &#39;Threading&#39;, &#39;Timers&#39;, &#39;Uri&#39;, &#39;UriBuilder&#39;, &#39;UriComponents&#39;, &#39;UriFormat&#39;, &#39;UriFormatException&#39;, &#39;UriHostNameType&#39;, &#39;UriIdnScope&#39;, &#39;UriKind&#39;, &#39;UriParser&#39;, &#39;UriPartial&#39;, &#39;UriTypeConverter&#39;, &#39;Web&#39;]<br>

<br>IP1 List:<br>[&#39;AccessViolationException&#39;, &#39;Action&#39;, &#39;ActivationContext&#39;, &#39;Activator&#39;, &#39;AppDomain&#39;, &#39;AppDomainInitializer&#39;, &#39;AppDomainManager&#39;, &#39;AppDomainManagerInitializationOptions&#39;, &#39;AppDomainSetup&#39;, &#39;AppDomainUnloadedException&#39;, &#39;ApplicationException&#39;, &#39;ApplicationId&#39;, &#39;ApplicationIdentity&#39;, &#39;ArgIterator&#39;, &#39;ArgumentException&#39;, &#39;ArgumentNullException&#39;, &#39;ArgumentOutOfRangeException&#39;, &#39;ArithmeticException&#39;, &#39;Array&#39;, &#39;ArraySegment&#39;, &#39;ArrayTypeMismatchException&#39;, &#39;AssemblyLoadEventArgs&#39;, &#39;AssemblyLoadEventHandler&#39;, &#39;AsyncCallback&#39;, &#39;Attribute&#39;, &#39;AttributeTargets&#39;, &#39;AttributeUsageAttribute&#39;, &#39;BadImageFormatException&#39;, &#39;Base64FormattingOptions&#39;, &#39;BitConverter&#39;, &#39;Boolean&#39;, &#39;Buffer&#39;, &#39;Byte&#39;, &#39;CLSCompliantAttribute&#39;, &#39;CannotUnloadAppDomainException&#39;, &#39;Char&#39;, &#39;CharEnumerator&#39;, &#39;CodeDom&#39;, &#39;Collections&#39;, &#39;Comparison&#39;, &#39;ComponentModel&#39;, &#39;Configuration&#39;, &#39;Console&#39;, &#39;ConsoleCancelEventArgs&#39;, &#39;ConsoleCancelEventHandler&#39;, &#39;ConsoleColor&#39;, &#39;ConsoleKey&#39;, &#39;ConsoleKeyInfo&#39;, &#39;ConsoleModifiers&#39;, &#39;ConsoleSpecialKey&#39;, &#39;ContextBoundObject&#39;, &#39;ContextMarshalException&#39;, &#39;ContextStaticAttribute&#39;, &#39;Convert&#39;, &#39;Converter&#39;, &#39;CrossAppDomainDelegate&#39;, &#39;DBNull&#39;, &#39;DataMisalignedException&#39;, &#39;DateTime&#39;, &#39;DateTimeKind&#39;, &#39;DateTimeOffset&#39;, &#39;DayOfWeek&#39;, &#39;Decimal&#39;, &#39;Delegate&#39;, &#39;Deployment&#39;, &#39;Diagnostics&#39;, &#39;DivideByZeroException&#39;, &#39;DllNotFoundException&#39;, &#39;Double&#39;, &#39;DuplicateWaitObjectException&#39;, &#39;EntryPointNotFoundException&#39;, &#39;Enum&#39;, &#39;Environment&#39;, &#39;EnvironmentVariableTarget&#39;, &#39;EventArgs&#39;, &#39;EventHandler&#39;, &#39;Exception&#39;, &#39;ExecutionEngineException&#39;, &#39;FieldAccessException&#39;, &#39;FileStyleUriParser&#39;, &#39;FlagsAttribute&#39;, &#39;FormatException&#39;, &#39;FtpStyleUriParser&#39;, &#39;GC&#39;, &#39;GCCollectionMode&#39;, &#39;GenericUriParser&#39;, &#39;GenericUriParserOptions&#39;, &#39;Globalization&#39;, &#39;GopherStyleUriParser&#39;, &#39;Guid&#39;, &#39;HttpStyleUriParser&#39;, &#39;IAppDomainSetup&#39;, &#39;IAsyncResult&#39;, &#39;ICloneable&#39;, &#39;IComparable&#39;, &#39;IConvertible&#39;, &#39;ICustomFormatter&#39;, &#39;IDisposable&#39;, &#39;IEquatable&#39;, &#39;IFormatProvider&#39;, &#39;IFormattable&#39;, &#39;IO&#39;, &#39;IServiceProvider&#39;, &#39;IndexOutOfRangeException&#39;, &#39;InsufficientMemoryException&#39;, &#39;Int16&#39;, &#39;Int32&#39;, &#39;Int64&#39;, &#39;IntPtr&#39;, &#39;InvalidCastException&#39;, &#39;InvalidOperationException&#39;, &#39;InvalidProgramException&#39;, &#39;LdapStyleUriParser&#39;, &#39;LoaderOptimization&#39;, &#39;LoaderOptimizationAttribute&#39;, &#39;LocalDataStoreSlot&#39;, &#39;MTAThreadAttribute&#39;, &#39;MarshalByRefObject&#39;, &#39;Math&#39;, &#39;Media&#39;, &#39;MemberAccessException&#39;, &#39;MethodAccessException&#39;, &#39;MidpointRounding&#39;, &#39;MissingFieldException&#39;, &#39;MissingMemberException&#39;, &#39;MissingMethodException&#39;, &#39;ModuleHandle&#39;, &#39;MulticastDelegate&#39;, &#39;MulticastNotSupportedException&#39;, &#39;Net&#39;, &#39;NetPipeStyleUriParser&#39;, &#39;NetTcpStyleUriParser&#39;, &#39;NewsStyleUriParser&#39;, &#39;NonSerializedAttribute&#39;, &#39;NotFiniteNumberException&#39;, &#39;NotImplementedException&#39;, &#39;NotSupportedException&#39;, &#39;NullReferenceException&#39;, &#39;Nullable&#39;, &#39;Object&#39;, &#39;ObjectDisposedException&#39;, &#39;ObsoleteAttribute&#39;, &#39;OperatingSystem&#39;, &#39;OperationCanceledException&#39;, &#39;OutOfMemoryException&#39;, &#39;OverflowException&#39;, &#39;ParamArrayAttribute&#39;, &#39;PlatformID&#39;, &#39;PlatformNotSupportedException&#39;, &#39;Predicate&#39;, &#39;Random&#39;, &#39;RankException&#39;, &#39;Reflection&#39;, &#39;ResolveEventArgs&#39;, &#39;ResolveEventHandler&#39;, &#39;Resources&#39;, &#39;Runtime&#39;, &#39;RuntimeArgumentHandle&#39;, &#39;RuntimeFieldHandle&#39;, &#39;RuntimeMethodHandle&#39;, &#39;RuntimeTypeHandle&#39;, &#39;SByte&#39;, &#39;STAThreadAttribute&#39;, &#39;Security&#39;, &#39;SerializableAttribute&#39;, &#39;Single&#39;, &#39;StackOverflowException&#39;, &#39;String&#39;, &#39;StringComparer&#39;, &#39;StringComparison&#39;, &#39;StringSplitOptions&#39;, &#39;SystemException&#39;, &#39;Text&#39;, &#39;ThreadStaticAttribute&#39;, &#39;Threading&#39;, &#39;TimeSpan&#39;, &#39;TimeZone&#39;, &#39;TimeoutException&#39;, &#39;Timers&#39;, &#39;Type&#39;, &#39;TypeCode&#39;, &#39;TypeInitializationException&#39;, &#39;TypeLoadException&#39;, &#39;TypeUnloadedException&#39;, &#39;TypedReference&#39;, &#39;UInt16&#39;, &#39;UInt32&#39;, &#39;UInt64&#39;, &#39;UIntPtr&#39;, &#39;UnauthorizedAccessException&#39;, &#39;UnhandledExceptionEventArgs&#39;, &#39;UnhandledExceptionEventHandler&#39;, &#39;Uri&#39;, &#39;UriBuilder&#39;, &#39;UriComponents&#39;, &#39;UriFormat&#39;, &#39;UriFormatException&#39;, &#39;UriHostNameType&#39;, &#39;UriIdnScope&#39;, &#39;UriKind&#39;, &#39;UriParser&#39;, &#39;UriPartial&#39;, &#39;UriTypeConverter&#39;, &#39;ValueType&#39;, &#39;Version&#39;, &#39;Void&#39;, &#39;WeakReference&#39;, &#39;Web&#39;, &#39;_AppDomain&#39;, &#39;__builtins__&#39;, &#39;__dict__&#39;, &#39;__name__&#39;]<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>
<br></blockquote></div><br></div>