Fork me on GitHub
#clr
<
2023-01-14
>
dmiller22:01:03

[ANN] clojureclr-1.12.0-alpha3 Some bug fixes. Most prominent are some things you can read about above.

6
gratitude-thank-you 4
👍 2
dangercoder23:01:25

Why is this giving me bad type .NET 6 is installed? I was expecting this dll to be found when running: Clojure.Main -m clj-api.main on ubuntu. Thanks

dangercoder23:01:02

Think I found the error. Microsoft.AspNetCore.Http is a partial class. In order to load HttpContext I need to load more dlls.

dangercoder23:01:41

Correct, in order to load Microsoft.AspNetCore.Http HttpContext I need to: (assembly-load-file "/usr/lib/dotnet/shared/Microsoft.AspNetCore.App/6.0.13/Microsoft.AspNetCore.Http.Abstractions.dll") This is cool, now I can build a .net core app via the repl. 🙂

👍 2
🆒 2
dangercoder21:01:11

So I thought. I've spent many hours trying to get https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.builder.webapplication?view=aspnetcore-6.0 to load (can't find the correct assembly, loaded everything in /usr/lib/dotnet/shared/Microsoft.AspNetCore.App/6.0.13)

dangercoder21:01:02

Microsoft.AspNetCore.Builder WebApplicationBuilder is available though but I want the WebApplication class. 😾

Toshik09:01:05

very interesting, thank you for sharing! How are you going to be hooking routes? via .MapGet etc...? When I was doing this I extended the original Clojure.Main with .Web sdk, and created a wrapper around WebApplication

dangercoder10:01:54

I’m using .MapGet and delegates. core.async can be used to interop with Tasks

dangercoder10:01:43

Next step is to remove boilerplate with macros and add e.g. json-> edn support. .NET Core is actually very usable from Clojure, compared to e.g. the java counterpart Spring.

Toshik14:01:44

are you sharing this work somewhere?

dangercoder14:01:01

Not yet, once I manage to load the WebApplication class directly from clojure-clr I’ll OSS it 🙂

dangercoder23:01:41

still no luck. Getting bad type whenever I try to reference (import '[Microsoft.AspNetCore.Builder WebApplication]) . According to packs/Microsoft.AspNetCore.App.Ref/6.0.13/ref/net6.0/Microsoft.AspNetCore.xml the Microsoft.AspNetCore.dll contains the WebApplication dll.

dangercoder23:01:41

still no luck. Getting bad type whenever I try to reference (import '[Microsoft.AspNetCore.Builder WebApplication]) . According to packs/Microsoft.AspNetCore.App.Ref/6.0.13/ref/net6.0/Microsoft.AspNetCore.xml the Microsoft.AspNetCore.dll contains the WebApplication dll.