Ploot
✅ AddHttpClient and AddHostedService
That code is functionally the same as what I'm running and exhibits the same behaviour. The incorrect HttpClient is injected when using the commented out line but works fine with the GetRequiredService method. Idk if I'm expecting something that's incorrect from the DI or if this is weird behaviour :akarishrug:
29 replies
Grainy gif output when using `Graphics` on source Bitmap
I hadn't actually thought to check the metadata, unfortunately MediaInfo is showing both the input and output to be identical from a metadata standpoint. Whatever is happening seems to be caused by the use of
Graphics
messing with the bitmap somehow as not calling any graphics g.DrawX
methods results in a 1:1 recreation of the input.
I did also try a lower smoothing mode but it was resulting in some pretty jagged lines, although that may be because my DrawStringOutlined
extension method is using a GraphicsPath
to draw the text and it's outline? I haven't tested much tbh and this is my first time using System.Drawing
stuff3 replies
New in the game
I second this ^
Different people learn in different ways so this advise won't be universal but for me personally I've always learnt the most when worked on something I've been passionate about and that has been somewhat outside my current knowledge but not crazy ambitious.
also, in case it needs saying, never be ashamed you have to look something up or ask others for help
14 replies
Don't start hosted services on start
Reflecting, it may very well be an architectural problem. Currently I don't know of a better way of handling this.
This problem arises because I am using this for a discord bot. The bot client itself is registered as a singleton with the DI collection and a hosted startup service performs configuration for this client and logs it in. My other hosted services are then using this discord client to perform various tasks independently (Think timers, checking channels for new messages, ect). My issue is coming from the other services attempting to use the client before it has chance to log in.
15 replies