ArgumentTypeException expected X got X

I started few weeks ago a project where I’m using C# References in IronPython. I have been trying a lot of stuff and everything was working so far. Now it got a bit complicated because my python scripter throws an exception I cannot really understand. It says expected value X, got value X.

So it is completely the same type what it gets, I also checked it with the isinstance() function. Some people on the internet are telling the path to the references may be the problem but I’m using this style:

script_dir = os.path.dirname(__file__)


clr.AddReferenceToFileAndPath(os.path.join(script_dir,'XXXX.dll'))

Thank you guys in advance, I hope there is someone who could give me tips. I’d really appreciate any help.

python

Hello,

Could you please send us a little example of a .NET app which uses the Scripter for IronPython that reproduces the problem?

Hello,

I solved the problem by using clr.AddReference() instead of AddReferenceToFileAndPath(). Probably the additional copy into sys.path caused the type error problem.