[Ironpython-users] Hosting ironpyhon in silverlight , get Could not add reference to assembly System.Windows.Controls error

Jimmy Schementi jschementi at gmail.com
Thu Jul 28 14:55:53 CEST 2011


There is no System.Windows.Controls.dll that ships with Silverlight,
it is in the Silverlight SDK, meaning you must provide it in your
application's XAP file.

~Jimmy



2011/7/28 曾东 <zdong at rliansoft.com>:
> Hi,
>
>
>
> I use this code in silverlight to run a script define outer
>
>
>
>              var setup = new ScriptRuntimeSetup();
>
>              setup.HostType = typeof(BrowserScriptHost);
>
>              setup.LanguageSetups.Add(Python.CreateLanguageSetup(null));
>
>              setup.Options["SearchPaths"] = new string[] { string.Empty };
>
>              Runtime = new ScriptRuntime(setup);
>
>              Scope=Runtime.CreateScope();
>
>
>
>              engine = Runtime.GetEngine("Python");
>
>
>
>
>
>
>
> The python script has some code to import windows.controls but it failed
> with "Could not add reference to assembly System.Windows.Controls"
>
>
>
> import clr
>
> clr.AddReference('System.Windows.Controls')
>
> from  System.Windows.Controls import *
>
>
>
> Could you kindly give me some suggestion ,thanks
>
>
>
> _______________________________________________
> Ironpython-users mailing list
> Ironpython-users at python.org
> http://mail.python.org/mailman/listinfo/ironpython-users
>
>


More information about the Ironpython-users mailing list