SharpFluids icon indicating copy to clipboard operation
SharpFluids copied to clipboard

'The type initializer for 'CoolPropPINVOKE' threw an exception.'

Open kurupt44 opened this issue 2 years ago • 6 comments

Hello,

Thince few days I have this exception when I test my soft :

System.TypeInitializationException : 'The type initializer for 'CoolPropPINVOKE' threw an exception.' 1/2 : TypeInitializationException : The type initializer for 'SWIGExceptionHelper' threw an exception. 2/2 : BadImageFormatException : Tentative de chargement d’un programme de format incorrect. (0x8007000B)

This exception appear during test but is not exactly during a coolprop calcul.

Thank you,

kurupt44 avatar Aug 21 '22 10:08 kurupt44

Hello,

I have the same issue with this. Also, I cannot find symbols for debugging. .pdb file is missing from the assembly. I have tried to build my solution with different frameworks and to 32-bit and 64-bit versions with no luck.

EDIT: I decompiled the code and found this from the DoubleVector.cs class: image

EDIT 2: I think the issues is that this DoubleVector.cs class do not handle Environment.Is64BitProcess. Am I correct?

If this helps? image

Attemainio avatar Dec 19 '22 10:12 Attemainio

You are correct that DoubleVector.cs did not handle 64Bit. I have accepted your commit - Can you test if you still get the error after the update?

MadsKirkFoged avatar Dec 19 '22 13:12 MadsKirkFoged

I use the Nuget package of this repostory. Is it possible to create a new Nuget so I can test the validity of the function?

Attemainio avatar Dec 19 '22 13:12 Attemainio

Nugets are automatic created when the code is being updated: It should be out: https://www.nuget.org/packages/SharpFluids/3.0.306

MadsKirkFoged avatar Dec 19 '22 13:12 MadsKirkFoged

Thank you! :) It works perfectly!

Attemainio avatar Dec 19 '22 13:12 Attemainio

This issue has been resolved

Attemainio avatar Dec 23 '22 08:12 Attemainio