.NET DLL Loading from PML Macro in E3D Environment

I am using import statement to import .NET assembly from PML macro.

import 'TestApp.PMLVisible'

using namespace 'TestApp.PMLVisible'

!!SAGTestInterface = object TestInterface()

!!SAGTestInterface.Launch()

 This approach requires DLLs to be co-located with the E3D installation, which restricts portability and centralized management of .NET dependencies. I have requirement to load .NET assemblies which are present in some network folder path.

What are the most robust methods for implementing custom assembly resolution in a PML context?  How can we create a flexible, configurable mechanism for specifying DLL search paths?

I tried adding network folder in system PATH environment variable. But it did not work. Any suggestions?

Parents
  • Instead of simply specifying the DLL file name during import, you can use its absolute path.
    For example, to import the DLL SampleAssembly.dll located under N:\AVEVA_Tools:

    import 'N:\AVEVA_Tools\SampleAssembly'

    Make sure not to include the .dll extension at the end, otherwise the path won't be recognized.

    In a real scenario, the path would ideally come from an environment variable defined in your launchers.
    With the previous example, suppose N:\AVEVA_Tools is stored in the environment variable AVEVA_TOOLS :
    !dllPath = !!evar('AVEVA_TOOLS') & '\SampleAssembly'
    import '$!dllPath'

Reply
  • Instead of simply specifying the DLL file name during import, you can use its absolute path.
    For example, to import the DLL SampleAssembly.dll located under N:\AVEVA_Tools:

    import 'N:\AVEVA_Tools\SampleAssembly'

    Make sure not to include the .dll extension at the end, otherwise the path won't be recognized.

    In a real scenario, the path would ideally come from an environment variable defined in your launchers.
    With the previous example, suppose N:\AVEVA_Tools is stored in the environment variable AVEVA_TOOLS :
    !dllPath = !!evar('AVEVA_TOOLS') & '\SampleAssembly'
    import '$!dllPath'

Children