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

Welcome Forums General PowerShell Q&A 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

 
Keymaster
1 year, 11 months ago.

  • Author
    Posts
  • #60229

    Participant
    Points: 0
    Rank: Member

    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

    Keymaster
    Points: 1,638
    Helping HandTeam Member
    Rank: Community Hero

    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.

The topic ‘Access function from two different DLLs with same namespace and diff. versio’ is closed to new replies.