Create your libraries as .net standard 2.0 projects. There is HttpClient and HttpMessageHandler support.
The models project should not reference the http client library. Maybe you need 3 projects, models, communication, and interface.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
My current hobby project is a sdk that implements an open http protocol. I would like to cover a few runtimes, mainly NET5, Framework 4.8 and mono. Where possible cross-platform Another specific purifier is it makes a continous long polling call. The runtime diversity is mainly for learning purposes and to enable building a few different clients.
I have 2 questions.
Runtimes Are the specified runtimes too incompatible? I am mainly using http client and purosfully avoiding the new C# features. Models are in a net standard 2 library.
Http interface I created a wrapper for the http client, this is to initialize it properly and helps in a DI register function. The wrapper implements a custom http interface that is just a copy of put, post etc. For auth (JWT) I am using http messagehandler in DI.
Can I even use this typ of massage handler with a general interface across these runtimes? Some http clients differ ever so slightly in some places across runtimes. Next to that If I wanted to use blazor it could get weird with that http client.
I wanted to just put http clients in seperate projecs, add models proj to those and have a core sdk project dat references http clients depending on build. But my models cause a cyclic reference like that. The crossed out models folder in the sdk project is an internal models namespace.
Create your libraries as .net standard 2.0 projects. There is HttpClient and HttpMessageHandler support.
The models project should not reference the http client library. Maybe you need 3 projects, models, communication, and interface.