Access function from two different DLLs with same namespace and diff. versio

This topic contains 1 reply, has 2 voices, and was last updated by  Don Jones 10 months, 1 week ago.

  • Author
    Posts
  • #60229

    David Koenig
    Participant

    Hi,

    i have two DLLs which are mostly identical but which different versions.
    c:\work\api\6.0.3.23456\API.dll
    c:\work\api\7.0.0.23967\API.dll

    I want to load both DLL files and store the link to the DLLs as variable in an Hash Table. During runtime i want to call function dynamically from the first or the second DLL file (depending on a variable in a given object). Is that possible with Powershell?

    Regards

    Dave

  • #60231

    Don Jones
    Keymaster

    It's maybe possible but it's going to be really, really tricky. This isn't "PowerShell" you're dealing with, it's .NET Framework's Interop layer, which s complex. Suggest doing a Google for "interior import specific dll path" and see if you find something that looks useful for you (there were several promising hits when I just tried). You may find it easier to do this in C#, which is a little "closer" to .NET's core than PowerShell.

You must be logged in to reply to this topic.