Environment
- Pythonnet version: 3.0.0rc4
- Python version: 3.9.13
- Operating System: Windows 11
- .NET Runtime: 4.8 (?)
Details
I am importing the DLL's for PLEXOS, a power system application compiled with .NET, to perform analysis on the simulation outputs, and I have built a wrapper around the .NET methods (see here for examples from the developers) to streamline the interaction. My use case is to use the API to extract data from a PLEXOS Solution File (a .zip with a bunch of binary files).
I've been trying to keep up with pythonnet updates and spend some time earlier in the year using alpha-2 which I was able to get working with minor updates. While I typically try to avoid alphas the latest PLEXOS versions are being compiled with .NET 6 and I wasn't having luck with 2.5.2; however, for compatibility they have also been providing the DLLs compiled with .NET 4.8 which is what I'm using here. (NOTE: I have since figured out that we're running into pythonnet/clr-loader#20 with the .NET 6 DLLs).
I've had a few spare cycles this week so I've been making updates to different tools including the wrapper mentioned above. One of these changes is updating from a2 to rc4, with the goal of bumping to the release when it is available. Unfortunately, I am running into some issues when trying to call the .NET methods and have been able to isolate that the code works with a2 and does not work with rc4.
With rc4 I am getting the following error:
Exception has occurred: NullReferenceException
Object reference not set to an instance of an object.
at PLEXOS_NET.Core.Solution.QueryToCSV(String strCSVFile, Boolean bAppendToFile, SimulationPhaseEnum SimulationPhaseId, CollectionEnum CollectionId, String ParentName, String ChildName, PeriodEnum PeriodTypeId, SeriesTypeEnum SeriesTypeId, String PropertyList, Object DateFrom, Object DateTo, String TimesliceList, String SampleList, String ModelName, AggregationEnum AggregationType, String Category, String Separator)
I suspect the issue is with the enumerations. However, I know data of the right types is being passed to the function since if I change any of the input arguments (e.g. SimulationPhaseId as a string) I will get a TypeError and a message that "No method matches given argument."
Looking for some direction on what to debug next and appreciate any insights!
Environment
Details
I am importing the DLL's for PLEXOS, a power system application compiled with .NET, to perform analysis on the simulation outputs, and I have built a wrapper around the .NET methods (see here for examples from the developers) to streamline the interaction. My use case is to use the API to extract data from a PLEXOS Solution File (a .zip with a bunch of binary files).
I've been trying to keep up with pythonnet updates and spend some time earlier in the year using alpha-2 which I was able to get working with minor updates. While I typically try to avoid alphas the latest PLEXOS versions are being compiled with .NET 6 and I wasn't having luck with
2.5.2; however, for compatibility they have also been providing the DLLs compiled with .NET 4.8 which is what I'm using here. (NOTE: I have since figured out that we're running into pythonnet/clr-loader#20 with the .NET 6 DLLs).I've had a few spare cycles this week so I've been making updates to different tools including the wrapper mentioned above. One of these changes is updating from a2 to rc4, with the goal of bumping to the release when it is available. Unfortunately, I am running into some issues when trying to call the .NET methods and have been able to isolate that the code works with a2 and does not work with rc4.
With rc4 I am getting the following error:
I suspect the issue is with the enumerations. However, I know data of the right types is being passed to the function since if I change any of the input arguments (e.g.
SimulationPhaseIdas a string) I will get aTypeErrorand a message that "No method matches given argument."Looking for some direction on what to debug next and appreciate any insights!