Hi @pavelsvoboda, Our team looked at the provided package and made the observations listed below. After you built TestRunFmeDesktop.exe using FMEObjectsDotNet4.dll from FME 2022, did you try running it on FME 2022 or another version?
From our findings, your TestRunFmeDesktop.exe should successfully run on FME 2022+, it will not run on FME 2021.x and earlier:
- The .NET project is referencing the FMEObjectsDotNet4.dll from an FME 2022 b22337 and the project was already successfully built into an executable TestRunFmeDesktop.exe
- We tried running the built TestRunFmeDesktop.exe on an FME 2022 b22347 and it successfully runs. (the application fails later on, but FME Objects was loaded successfully)
- We tried running your TestRunFmeDesktop.exe on an older FME 2021.2 b21801 and it fails with the exception Unhandled Exception: System.IO.FileLoadException: A procedure imported by 'FMEObjectsDotNet4.dll' could not be loaded. as described by the original question above.
My colleague was also going to suggest leveraging IFMEWorkspaceRunner, which is a better way to go than using .NET to do low-level reading and writing via FME Objects. However, it looks like you are already creating an IFMEOWorkspaceRunner in your project for running a workspace, so you are already on your way there.