[ANN] clojureclr-1.12.0-alpha3 Some bug fixes. Most prominent are some things you can read about above.
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
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)
Microsoft.AspNetCore.Builder WebApplicationBuilder is available though but I want the WebApplication class. 😾
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
I’m using .MapGet and delegates. core.async can be used to interop with Tasks
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.
are you sharing this work somewhere?
Not yet, once I manage to load the WebApplication class directly from clojure-clr I’ll OSS it 🙂
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.
Think I found the error. Microsoft.AspNetCore.Http is a partial class. In order to load HttpContext I need to load more dlls.
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. 🙂