I just updated DWSIM from version 7 to 7.1.2, and I am facing an issue with DWSIM.Automation.Automation2.LoadFlowsheet when loading a DWSIM simulation into my Python package. It was working properly right before updating. Does anybody have the same issue? I am pasting the error verbose here:
Ps1: I checked the path to the simulation, and it is accurate.
Ps2: The references to the DWSIM dlls have been added successfully, i.e I can instanciate a DWSIM.Automation.Automation2.LoadFlowsheet object but I cannot load a simulation.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I added reference to System.Buffers.dll, but I still got the same issue:
Traceback (most recent call last):
File "C:\Users\lfsfr\Desktop\pyDWSIMopt\examples\SMR_LNG\bug_LoadFlowsheet.py", line 33, in <module>
flowsheet = interf.LoadFlowsheet(path2sim)
System.IO.FileNotFoundException: Não foi possível carregar arquivo ou assembly 'System.Buffers, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' ou uma de suas dependências. O sistema não pode encontrar o arquivo especificado.
em SkiaSharp.SKManagedStream.CopyTo(SKWStream destination)
em SkiaSharp.SKManagedStream.ToMemoryStream()
em SkiaSharp.SKTypeface.FromStream(SKStreamAsset stream, Int32 index)
em DWSIM.Drawing.SkiaSharp.GraphicsSurface..ctor() na C:\Users\Daniel\source\repos\DanWBR\dwsim\DWSIM.Drawing.SkiaSharp\GraphicsSurface\DesignSurface.vb:linha 87
em DWSIM.FlowsheetBase.FlowsheetBase..ctor() na C:\Users\Daniel\source\repos\DanWBR\dwsim\DWSIM.FlowsheetBase\FlowsheetBase.vb:linha 42
em DWSIM.UI.Forms.Flowsheet.InitializeComponent() na C:\Users\Daniel\source\repos\DanWBR\dwsim\DWSIM.UI.Desktop.Forms\Forms\Flowsheet\Flowsheet.eto.cs:linha 161
em DWSIM.Automation.Automation2.LoadFlowsheet(String filepath) na C:\Users\Daniel\source\repos\DanWBR\dwsim\DWSIM.Automation\Interface.cs:linha 158
I am running:
- Python 3.9.1,
- DWSIM v7.1.2,
- pythonnet 2.5.2
Hey all,
I just updated DWSIM from version 7 to 7.1.2, and I am facing an issue with
DWSIM.Automation.Automation2.LoadFlowsheet
when loading a DWSIM simulation into my Python package. It was working properly right before updating. Does anybody have the same issue? I am pasting the error verbose here:Ps1: I checked the path to the simulation, and it is accurate.
Ps2: The references to the DWSIM dlls have been added successfully, i.e I can instanciate a
DWSIM.Automation.Automation2.LoadFlowsheet
object but I cannot load a simulation.Try adding a reference to System.Buffers.dll, it should be there in DWSIM's directory.
I added reference to System.Buffers.dll, but I still got the same issue:
Traceback (most recent call last): File "C:\Users\lfsfr\Desktop\pyDWSIMopt\examples\SMR_LNG\bug_LoadFlowsheet.py", line 33, in <module> flowsheet = interf.LoadFlowsheet(path2sim) System.IO.FileNotFoundException: Não foi possível carregar arquivo ou assembly 'System.Buffers, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' ou uma de suas dependências. O sistema não pode encontrar o arquivo especificado. em SkiaSharp.SKManagedStream.CopyTo(SKWStream destination) em SkiaSharp.SKManagedStream.ToMemoryStream() em SkiaSharp.SKTypeface.FromStream(SKStreamAsset stream, Int32 index) em DWSIM.Drawing.SkiaSharp.GraphicsSurface..ctor() na C:\Users\Daniel\source\repos\DanWBR\dwsim\DWSIM.Drawing.SkiaSharp\GraphicsSurface\DesignSurface.vb:linha 87 em DWSIM.FlowsheetBase.FlowsheetBase..ctor() na C:\Users\Daniel\source\repos\DanWBR\dwsim\DWSIM.FlowsheetBase\FlowsheetBase.vb:linha 42 em DWSIM.UI.Forms.Flowsheet.InitializeComponent() na C:\Users\Daniel\source\repos\DanWBR\dwsim\DWSIM.UI.Desktop.Forms\Forms\Flowsheet\Flowsheet.eto.cs:linha 161 em DWSIM.Automation.Automation2.LoadFlowsheet(String filepath) na C:\Users\Daniel\source\repos\DanWBR\dwsim\DWSIM.Automation\Interface.cs:linha 158
I am running:
- Python 3.9.1,
- DWSIM v7.1.2,
- pythonnet 2.5.2
A minimalistic code to reproduce the error:
The current workaround is to put this dll somewhere else and then add a reference to it in your python code before creating the automation instance.
That worked! Thanks a lot Daniel!
For the record, one may need to register this new System.Buffers.dll in order to add a reference to it in a python code.