[IronPython] IronPython 2.6.1 for .NET 4.0 RC targeting Silverlight

Jimmy Schementi Jimmy.Schementi at microsoft.com
Sat Apr 10 22:22:30 CEST 2010


To embed IronPython (CLR2 SL build) in a Silverlight 4 app, you have to add a reference to Microsoft.Scripting.ExtensionAttribute.dll to make sure types defined in both System.Core.dll and Microsoft.Scripting.Core.dll are used from the latter assembly.

Again, Keep in mind the dynamic type in C# won't work in this case; you'll need to build IronPython against SL4 from source to to get that functionality.

Let me know if this works for you. 

~Jimmy

On Apr 9, 2010, at 3:46 PM, "David Matson" <dmatson at gmail.com> wrote:

> Just for clarity's sake here are the 5 warnings and 1 error I receive.
> 
> Warning	1	The predefined type
> 'System.Runtime.CompilerServices.ExtensionAttribute' is defined in
> multiple assemblies in the global alias; using definition from
> 'c:\Program Files (x86)\Reference
> Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Core.dll'
> Warning	2	The predefined type
> 'System.Runtime.InteropServices.DefaultParameterValueAttribute' is
> defined in multiple assemblies in the global alias; using definition
> from 'c:\Program Files (x86)\Reference
> Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.dll'
> Warning	3	The predefined type
> 'System.Runtime.CompilerServices.CallSiteBinder' is defined in
> multiple assemblies in the global alias; using definition from
> 'c:\Program Files (x86)\Reference
> Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Core.dll'
> Warning	4	The predefined type
> 'System.Runtime.CompilerServices.CallSite' is defined in multiple
> assemblies in the global alias; using definition from 'c:\Program
> Files (x86)\Reference
> Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Core.dll'
> Warning	5	The predefined type
> 'System.Runtime.CompilerServices.CallSite' is defined in multiple
> assemblies in the global alias; using definition from 'c:\Program
> Files (x86)\Reference
> Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Core.dll'
> Error	6	The type 'System.Dynamic.ExpandoObject' exists in both
> 'c:\Program Files (x86)\Reference
> Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Core.dll'
> and '\IronPythonDlls\Microsoft.Scripting.Core.dll'
> 
> 
> On Fri, Apr 9, 2010 at 4:40 PM, David Matson <dmatson at gmail.com> wrote:
>> Jimmy,
>> 
>> I was using the DLLs from the .NET 2.0 release and that worked fine
>> albeit there are several warnings regarding types existing in both the
>> .NET and the IronPython assemblies. However, I tried to use an
>> ExpandoObject and now I get the error:
>> 
>> The type 'System.Dynamic.ExpandoObject' exists in both 'c:\Program
>> Files (x86)\Reference
>> Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Core.dll'
>> and '\IronPythonDlls\Microsoft.Scripting.Core.dll'
>> 
>> 
>> On Fri, Apr 9, 2010 at 4:33 PM, Jimmy Schementi
>> <Jimmy.Schementi at microsoft.com> wrote:
>>>> The MSI I downloaded from the link in my previous posts installs to
>>>> the following:
>>>> C:\Program Files (x86)\IronPython 2.6 for .NET 4.0 RC\
>>>> 
>>>> There is no Silverlight folder as there is in the 2.6.1 download for
>>>> .NET 2.0. If I try to add the dlls in the root of that folder I get
>>>> the following message:
>>>> 
>>>> "You can't add a reference to IronPython.dll as it was not built
>>>> against the Silverlight runtime. Silverlight projects will only work
>>>> with Silverlight assemblies."
>>>> 
>>>> Am I missing something? Thanks for your help.
>>> 
>>> Since the current stable version of Silverlight is Silverlight 3, which is a subset of .NET 3.5, we only include Silverlight binaries in the version of IronPython for .NET 2.0: http://ironpython.codeplex.com/releases/view/40144. When Silverlight 4 is considered the stable version, which is a subset of .NET 4, "IronPython for .NET 4.0" will contain binaries build against Silverlight 4. Note that those Silverlight binaries will run on Silverlight 4, they just aren't built against Silverlight 4, so any .NET 4.0 specific features (like "dynamic" interop) are not available, but normal app development works.
>>> 
>>> ~Jimmy
>>> _______________________________________________
>>> Users mailing list
>>> Users at lists.ironpython.com
>>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>>> 
>> 
>> 
>> 
>> --
>> David Matson
>> dmatson at gmail.com
>> 
> 
> 
> 
> -- 
> David Matson
> dmatson at gmail.com
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
> 



More information about the Ironpython-users mailing list