Menu

When compiling DWSIM by clonning the project running Python.NET raises exception

AlbertoB
2023-03-22
2023-03-23
  • AlbertoB

    AlbertoB - 2023-03-22

    Dear all!

    Cloning commit (cccce25) and building it using Visual Studio 2019 DWSIM.sln Debug-x64 under Windows 11 raises an excpetion flag whenever Python.Net is selected under a Python UO or Script Manager.

    The exception is as follows:

    System.TypeInitializationException: The type initializer for 'Python.Runtime.UcsMarshaler' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly

    Any ideas how to solve it?


    UPDATE 1:
    Trying different commits some of them work and others don't. For example:

    commit 51d371b4 works running it as Debug X64 and Release X64.
    commit 46385a5 doesn't work at all
    commit 9ccc10d0 doesn't work at all
    commit d80715de works when running as DebugX64 but not with ReleaseX64

    I am quite lost here since the InitializePythonEnvironment in all cases is the same.


    UPDATE 2:
    Replacing all the files from DWSIM\bin\x64\Release with DWSIM\bin\x64\Debug. Solves the problem. Why? Is there a configuration file or registry which is not touched by the compiler?

    Best regards

     

    Last edit: AlbertoB 2023-03-23
    • Daniel Medeiros

      Daniel Medeiros - 2023-03-23

      try clearing the bin folder before compiling.

       

Log in to post a comment.