Topics

.NET Core: Can't reach imported static C#-classes in IronPython using .NET Core

thomas.jh.jansson@...
 

Hi everyone,
I am currently porting an existing code base using .NET Framework and IronPython to .NET Core.
In .NET Core it seems like the statement "from System.IO import *" does not import static classes such as File; this works fine when using .NET Framework.

I've attached an example solution containing a working .NET Framework example: IronPy.FrameworkTest
and also a failing example using .NET Core: IronPy.CoreTest.

Does anyone know of any differences between how static C# classes are handled differently in IronPython for .NET Core vs. .NET Framework?
Any help would be appreciated!

Best regards
Thomas Jansson

St├ęphane Lozier
 

.NET Core has a different set of assemblies. Try doing a "clr.AddReference(' System.IO.FileSystem')" before your import.

thomas.jh.jansson@...
 

This solved my problem, thank you!

/Thomas