Manu, thank you very much for your suggestions...
So, far I have .dll and these are not the solutions.
Also, the exact same code works in IronPython, b.t.w.....

Well, the error does come from the "ExamRecordLoader", here is the output:

c:\Test_MW\Tools\GuiTest>python getExamRecord.py
Load Exam Record
Could not load Exam Record:  Error loading ExamRecord binary file:
C:\\Test_MW\\Tools\\ExamRecords\\Resp4DCT Column requires a valid DataType.
   at ExamRecordHelper.ExamRecordLoader.LoadExamRecord(String filename)
   at ExamRecordHelper.ExamRecordLoader..ctor(String filename)

And this is the source:

import clr
try:
    ExRHelperAsseblyRef =
clr.AddReference("C:\\Test_MW\\Tools\\GuiTest\\ExamRecordHelper.dll")
    from ExamRecordHelper import *

except Exception, e:
    print("Exception : " + str(e))

# path to binary file:
examRecordFile = r'C:\\Test_MW\\Tools\\ExamRecords\\Resp4DCT'

try:
    print "Load Exam Record"
    exrec = ExamRecordLoader(examRecordFile) # <<<<<<<<<<<<<<<<<<<<<
Exception line
    stepList=exrec.GetStepList()
    print "stepList="+str(stepList)
except Exception as e:
    print "Could not load Exam Record: ", str(e)

Alex.

On Wed, Jan 27, 2021 at 3:54 PM Emmanuel Rutovic <m...@aesim.tech> wrote:

> Hi Alex,
>
> It seems that the exception is thrown inside your method
> "ExamRecordLoader" so it is hard to debug.
> Is it possible that the error is thrown because of different working
> directories? Can you try to use the full path to 'MyBinaryFile.bin' ?
>
> Also, I always use the file name including the extension (
> clr.AddReference("C:\ExamRecordHelper*.dll*") ) but I doubt it will
> change anything
>
> I hope it helps,
> Manu.
>
>
>
> On Wed, Jan 27, 2021 at 2:47 PM Alexander Masis <alexma...@gmail.com>
> wrote:
>
>> The code in the original post works in IronPython ( i.e. loaderObj =
>> ExamRecordLoader( 'MyBinaryFile.bin') this line has no exceptions in
>> IronPython )
>> _______________________________________________
>> PythonNet mailing list -- pythonnet@python.org
>> To unsubscribe send an email to pythonnet-le...@python.org
>> https://mail.python.org/mailman3/lists/pythonnet.python.org/
>> Member address: m...@upsim.tech
>>
> _______________________________________________
> PythonNet mailing list -- pythonnet@python.org
> To unsubscribe send an email to pythonnet-le...@python.org
> https://mail.python.org/mailman3/lists/pythonnet.python.org/
> Member address: alexma...@gmail.com
>
_______________________________________________
PythonNet mailing list -- pythonnet@python.org
To unsubscribe send an email to pythonnet-le...@python.org
https://mail.python.org/mailman3/lists/pythonnet.python.org/
Member address: arch...@mail-archive.com

Reply via email to