>> import CLR >> from CLR.System.Reflection import Assembly >> >> my_dll_name = Assembly.LoadWithPartialName( path to dll that does >> not include .dll extension ) >> >> #import namespaces >> from CLR import TopNamespace > > 1. Installing Python for .NET as a standalone, and using it in the > interactive session, all of the above, apart from 'from CLR import > TopNamespace' works. 'from CLR import TopNamespace' gets > 'ImportError: cannot import name TopNamespace'.
If your C# source file contains something along the lines of: namespace MyLib { public class MyClass { ... } } and, say, is compiled to a DLL called A_LIB.DLL and placed in your current directory, then in python.net it would be: from CLR.System.Reflection import Assembly a = Assembly.LoadWithPartialName("A_LIB") from CLR.MyLib import MyClass -H. _________________________________________________ Python.NET mailing list - PythonDotNet@python.org http://mail.python.org/mailman/listinfo/pythondotnet