LunchMarble
LunchMarble

Reputation: 5141

How do I import non namespaced types into IronPython?

I have a C# .NET classes that exist outside of a namespace that need to be accessed inside of IronPython. Typically I would do:

import SomeNamespace
from SomeNamespace import *

However, I do not have a namespace.

Upvotes: 5

Views: 112

Answers (1)

peacemaker
peacemaker

Reputation: 2591

Import your assembly like usual, then just import the class name:

import clr
clr.AddReference("MyAssembly") 
import MyGlobalClass

Upvotes: 4

Related Questions