clr

Eugen 2023-10-16T10:34:48.040309Z

hi, does anyone know if I could call .NET Framework version 4 code from clojure clr? Context: No experience with .NET . Romanian government has an app built with .net framework 4 for which I have the DLL's and full app (installer) I would like to make some integrations. Could I call code from those DLL's from clojure CLI? Any examples?

jamesd3142 2023-10-17T05:51:36.865059Z

I'm doing similar with a dotnet 7 project. My setup looks like this https://gist.github.com/jamesdavidson/58adb94129fe5b1c3832eed9014923e8 which is based on how https://github.com/Dangercoder/potion works. Coming from the JVM it took me a while to work out that I needed to do (assembly-load "Foo") before I could import classes from Foo.dll . Hope that helps

Eugen 2023-10-17T05:56:19.670019Z

thanks, I will check it out

Eugen 2023-10-18T07:22:56.328199Z

thanks. any idea if assemblies are cross platform? the app is for Windows, I would like to try it on Linux. I assume the native gui bits will not work, but if any code is library, could it work?

jamesd3142 2023-10-18T07:27:36.217229Z

I think .NET Framework 4 is a Windows only thing but honestly without familiarity in the whole Microsoft ecosystem I find it so confusing

Eugen 2023-10-18T09:42:11.746419Z

thanks. I have the same hunch.

Eugen 2023-10-18T09:42:23.624359Z

I will do some research

dmiller 2023-10-17T14:24:23.870549Z

ClojureCLR is compatible with Framework 4.x and .Net 6/7 (and soon 😎 Yes, the assembly-loads are necessary. (I've contemplated adding a clause to the ns form to do it. Some code analysis packages assume the ns comes first. Nothing you are likely to be troubled by at this point.)