Menu

Errors in Automation2

Qinghe Gao
2022-10-24
2022-10-24
  • Qinghe Gao

    Qinghe Gao - 2022-10-24

    Hi all

    I recently ran into issue when I re-run the codes, the automation2 caused error :

    interf = Automation2()
    Exception has occurred: NullReferenceException Object reference not set to an instance of an object.

    It seems like we can only open one automation 2 but I don't know how to restart it in visual studio code.

    And errors also said:

    APP CRASH!!!

    System.InvalidOperationException: The Eto.Forms Platform is already initialized.
    at Eto.Platform.Initialize(Platform platform)
    at Eto.Forms.Application..ctor(Platform platform)
    at DWSIM.UI.Desktop.Program.MainApp(String[] args)

    Anyone knows how to solve it?

    Thanks in advance!

     
    • Daniel Medeiros

      Daniel Medeiros - 2022-10-24

      try Automation3()

       
      • Qinghe Gao

        Qinghe Gao - 2022-10-24

        Hi Daniel

        Thanks for the quick reply.
        I just tried Automation3()

        And it gave errors:

        Exception has occurred: FileNotFoundException
        Could not load file or assembly 'System.Buffers, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
        at SkiaSharp.SKManagedStream.CopyTo(SKWStream destination)
        at SkiaSharp.SKManagedStream.ToMemoryStream()
        at SkiaSharp.SKTypeface.FromStream(SKStreamAsset stream, Int32 index)
        at DWSIM.Drawing.SkiaSharp.GraphicsSurface..ctor() in C:\Users\Daniel\source\repos\DanWBR\dwsim\DWSIM.Drawing.SkiaSharp\GraphicsSurface\DesignSurface.vb:line 102
        at DWSIM.FlowsheetBase.FlowsheetBase..ctor() in C:\Users\Daniel\source\repos\DanWBR\dwsim\DWSIM.FlowsheetBase\FlowsheetBase.vb:line 44
        at DWSIM.Automation.Flowsheet2..ctor(Action`2 messageListener, Action updateUIhandler) in C:\Users\Daniel\source\repos\DanWBR\dwsim\DWSIM.Automation\Flowsheet2.cs:line 25
        at DWSIM.Automation.Automation3.CreateFlowsheet() in C:\Users\Daniel\source\repos\DanWBR\dwsim\DWSIM.Automation\Automation.cs:line 352

        ** Do I need to download extra stuff? Thanks in advance!**

        Best,
        Qinghe

         
        • Daniel Medeiros

          Daniel Medeiros - 2022-10-24

          add this to the assembly loading part:

          clr.AddReference(dwsimpath + "System.Buffers.dll")

           
          • Qinghe Gao

            Qinghe Gao - 2022-10-24

            Hi Daniel

            I added the code but it still had same error. Not sure how to solve it.
            Not sure if I need to reintsall the System.Buffers?

            Best,
            Qinghe