-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using SharpFluids in a .Net 4.6.1 Class Library, getting 'Coolprop.dll not found' error after rebuilds #36
Comments
I somethings get the error myself when starting up a new project. I believe it is because the Nuget have to copy over the "Coolprop.dll" and sometimes it just doesn't do it. I can just press "Rebuild" and it then copies the dll correctly. What you are talking about it using SharpFluids inside a Fix: |
Thank you very much for this help! One question: I did manage to find and set the packages properties to 'Copy if newer', but I'm not sure what level in the files you'd move CoolProp.dll and CoolProp64.dll to. I copied and pasted both .dll files to my library's Project folder (so, on the same level as the other .cs files), and set both to |
Unfortunately, despite looking online for answers regarding this bug, I haven't found anything yet. What you described seems very likely the source of this glitch, rather than something to do with SharpFluids in particular, but I haven't been able to implement the solution that you suggested. |
|
|
I've been getting an inconsistent issue with SharpFluids since changing a project to a library to add to another, larger project. The first time my project tries to create a fluid with 'Fluid f = new Fluid(FluidList.Water);' I get an exception. It appears that the code is not finding the CoolProp.dll when it tries to convert the FluidList object to a Fluid object. I've confirmed that the CoolProp.dll is present in the Debug folder, and that I'm properly calling 'using SharpFluids;' at the start and all.
Mystifyingly, the workaround I've found so far is to comment out that first 'Fluid f =' line, let my code run, and after it crashes because Fluid f is a null reference object, I un-comment out that code and it runs perfectly fine.
I suspect it's either an issue with the loading order for my project, or maybe it's an issue with the .Net framework I'm using. Any insights at all would be appreciated.
Additional Information:
SharpFluids being used is version 3.0.270 but has been observed on multiple versions
The full error is this: System.TypeInitializationException: The type initializer for 'CoolPropPINVOKE' threw an exception. ---> System.TypeInitializationException: The type initializer for 'SWIGExceptionHelper' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'CoolProp': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
The text was updated successfully, but these errors were encountered: