Fork me on GitHub
#clr
<
2023-10-16
>
Eugen10:10:48

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?

jamesd314205:10:36

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

Eugen05:10:19

thanks, I will check it out

dmiller14:10:23

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.)

Eugen07:10:56

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?

jamesd314207:10:36

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

Eugen09:10:11

thanks. I have the same hunch.

Eugen09:10:23

I will do some research