dllapldyalog

New dll in Dyalog APL


Is it possible to use a new dll in Dyalog APL? I can use the existing dll's just by setting ⎕USING, but this does not work if I download a new dll. Simply copying the dll in the directory and calling ⎕USING←'new_dll,new_dll.dll gives me the error:

Assembly load failed:
Could not load file or assembly 'C:\Program Files\Dyalog\Dyalog APL-64 19.0 Unicode\new_dll.dll' or one of its dependencies. The system cannot find the file specified.
Could not load file or assembly 'file:///C:\Windows\Microsoft.NET\Framework64\v4.0.30319\new_dll.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)

So I guess I must be missing some step. Has anyone done it?

More precisely, I want to use EPPLUS and IronXL in Dyalog APL.


Solution

  • I will use as an example the NuPkg Newtonsoft.Json as it is available under the MIT License.

    1. I downloaded the package from nuget.org/packages/Newtonsoft.Json

    2. Important step: In Windows Explorer, I right clicked on the .nupkg file and chose Properties. I ticked the Unblock button.

    3. I used an unzip program to extract all the files inside the .nupkg package file.

    4. In Dyalog, I verify that I can do some very basic operations with the Newtonsoft.Json namespace:

          ⎕using←'Newtonsoft.Json,D:\cust\tp5dec24\lib\net45\newtonsoft.json.dll'
          JsonConvert
    (Newtonsoft.Json.JsonConvert)
          JsonConvert.DefaultSettings
    [Null]
          serializer←⎕NEW JsonSerializer
          serializer
    Newtonsoft.Json.JsonSerializer
          ]assemblies
    mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089                 
    bridge190-64_unicode, Version=19.0.50074.0, Culture=neutral, PublicKeyToken=eb5ebc232de94dcf
    System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089              
    dyalognet, Version=19.0.50074.0, Culture=neutral, PublicKeyToken=eb5ebc232de94dcf           
    System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089                   
    System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089     
    System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a           
    System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a     
    System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089               
    Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed         
    System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089              
    

    Regards,

    Vince