[IronPython] Newbie question about importing from System.Windows

Dino Viehland dinov at microsoft.com
Fri May 7 20:14:12 CEST 2010


Matt wrote:
> I'm running IronPython 2.6.1 for .NET 4.0, and have installed Visual Studio
> 2010 and Silverlight 4SP2.  I tried to import System.Windows.Controls, but got
> an error that "Windows" does not exist.  Trying to run ipy from the command
> line and running this:
> 
> >>> import System
> >>> dir(System)
> 
> ... confirms that there is no "Windows" entry.  Could another "System" be
> taking precedence?  How can I find out?
> 
> Thanks in advance for any help you can lend.


You'll need to do a clr.AddReference('PresentationCore') call before you can
access types related to WPF.  IronPython includes an avalon.py in the
Tutorial directory which will do this as well as adding references to 
PresentationFramework and WindowsBase which are other assemblies that make
up WPF.






More information about the Ironpython-users mailing list