VS.NET 2010 beta2
I'm trying to take an existing DLR-based component, compile it against SL4, and use it in an SL4 app, like this...
var dlrComponent = new DlrComponent( "some initialization goo" );
var result = dlrComponent.Execute( obj1, obj2 );
// this is where DLR kicks in, executes code dynamically, produces some result...
this.textBlock1.Text = result.ToString();
The project that contains DlrComponent references Microsoft.Dynamic and Microsoft.Scripting, built from 0.92 sources for SL4 (release). It compiles fine. At runtime, I get MemberAccessException for the first CallSite invoking a delegate.
I (sort of) understand SL security... DynamicMethod.Invoke is SecuritySafeCritical, so SL is clearly not happy invoking that method. But it's not clear to me why. Apparently there's some additional knob to twist to make SL security policy happy with my code
as ultimate caller into DLR? Or perhaps there's no easy way to do that?
I've looked at MS.Scripting.Silverlight, but I didn't see anything particularly special about it from a privileged operation standpoint... and anyway, it's not really my usage model, since I'm not hosting a language in an HTML script so much as invoking
a DLR-based component from a code-behind.
So, question... how do I go from CodePlex DLR source --> SL-based custom DLR component --> usage in an SL application?
Confused, but very hopeful... thanks in advance for any help!