michael
michael

Reputation: 23

Problem importing System.Dynamic in IronPython

I'm obviously missing something trivial, but I can't seem to import from System.Dynamic; to wit:

import clr
clr.AddReference('System.Dynamic')

which clearly adds the salient reference:

clr.References[2]
(< System.Dynamic, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a>)

but importing fails

import System.Dynamic

results in:

Traceback (most recent call last):
File "", line 1, in
ImportError: No module named Dynamic

What basic thing am I missing?

Upvotes: 2

Views: 490

Answers (1)

Dino Viehland
Dino Viehland

Reputation: 6486

The System.Dynamic assembly in .NET 4.0 actually includes no public surface area. It just has a bunch of internal types which are visible to the C# runtime assembly that are used for COM interop. The decision to make this all internal was made late enough in the product cycle that the assembly still remains.

Likely you want Microsoft.Dynamic instead which contains a superset of the functionality in System.Dynamic. Microsoft.Dynamic is shipped w/ IronPython.

Upvotes: 1

Related Questions