DLR with .NET 4 Beta 2 DynamicObject

Dec 17, 2009 at 10:16 PM

I have a library that exposes JSON as dynamic objects using the DynamicObject in .NET 4 Beta 2. However, when I take an instance of my JsonObject and send it as a variable into the DLR (via ScriptScope.SetVariable), it won't access any of the dynamic properties of the object. I know that there is a duplication of DynamicObject among the DLR and .NET 4 (Microsoft.Scripting.Core vs System.Core). How can I resolve this discrepancy?

Dec 17, 2009 at 10:21 PM
Microsoft.Scripting.Core and System.Core are basically identical, so you shouldn't use Microsoft.Scripting.Core, but make sure you’re using a .NET 4.0 build of the DLR (Microsoft.Scripting and Microsoft.Dynamic). Let us know if you still have issues (a repro would be helpful).
Coordinator
Dec 17, 2009 at 10:26 PM

What language is then accessing the variable from the scope?  You’ll need to use a language which is built against .NET 4.0 or it to be able to see the dynamic members.  For example IronPython is available here: http://ironpython.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=28125 and IronRuby is available here: http://ironruby.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=33305

From: richardgavel [mailto:notifications@codeplex.com]
Sent: Thursday, December 17, 2009 2:17 PM
To: Dino Viehland
Subject: DLR with .NET 4 Beta 2 DynamicObject [dlr:78494]

From: richardgavel

I have a library that exposes JSON as dynamic objects using the DynamicObject in .NET 4 Beta 2. However, when I take an instance of my JsonObject and send it as a variable into the DLR (via ScriptScope.SetVariable), it won't access any of the dynamic properties of the object. I know that there is a duplication of DynamicObject among the DLR and .NET 4 (Microsoft.Scripting.Core vs System.Core). How can I resolve this discrepancy?

Read the full discussion online.

To add a post to this discussion, reply to this email (dlr@discussions.codeplex.com)

To start a new discussion for this project, email dlr@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

Dec 17, 2009 at 10:49 PM

Thanks. That did the trick. I went ahead and grabbed IronPython 2.6 CTP for .NET 4 Beta 2 just because it was a precompiled set of assemblies, though I will try with a manual compile of DLR 0.92 later.

If I wanted my code to work with .NET 3.5, would I just need to have my JsonObject code inherit from the DynamicObject class in Microsoft.Scripting.Core and then use non-4 version of IronPython?

Coordinator
Dec 18, 2009 at 12:45 AM

Correct on how to support 3.5 – so you’ll need to have 2 builds just like IronPython does.

From: richardgavel [mailto:notifications@codeplex.com]
Sent: Thursday, December 17, 2009 2:50 PM
To: Dino Viehland
Subject: Re: DLR with .NET 4 Beta 2 DynamicObject [dlr:78494]

From: richardgavel

Thanks. That did the trick. I went ahead and grabbed IronPython 2.6 CTP for .NET 4 Beta 2 just because it was a precompiled set of assemblies, though I will try with a manual compile of DLR 0.92 later.

If I wanted my code to work with .NET 3.5, would I just need to have my JsonObject code inherit from the DynamicObject class in Microsoft.Scripting.Core and then use non-4 version of IronPython?

Read the full discussion online.

To add a post to this discussion, reply to this email (dlr@discussions.codeplex.com)

To start a new discussion for this project, email dlr@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com