I\'m trying to use IronPython as an intermediary between a C# GUI and some C# libraries, so that it can be scripted post compile time.
I have a Class library DLL that is
This error indicates that your assembly is getting loaded into multiple CLR loader contexts. Rather than adding the reference using clr.AddReferenceToFile you can either switch to clr.AddReference or you can load the assembly from C#. For the former you need to make sure that the assembly is available somewhere that .NET can normally load it (the GAC or in the application base of the process). For the latter you can just do:
engine.Runtime.LoadAssembly(typeof(MyClass).Assembly);
from your C# host code. Personally I like this 2nd solution a little bit more because not only does it work it saves your users from needing to do the clr.AddRef call from Python.