SteveTheMadLad
Issues loading DLL
It may be that the DLL is compiled for x64, or has dependencies of its own that can't be found and loaded (possibly because they're located somewhere Windows doesn't look). I haven't used it in ages, but I think you can still find a tool called Dependency Walker, it would tell you what other DLLs a given DLL depends on. Give it your DLL and see what it says.
I don't know much about native win32 programming, but while you do specify the full path to the main DLL, if it has dependencies, the OS is going to look for them according to some default logic. There are WinAPI functions such as SetDllDirectory and AddDllDirectory that you can use to control where the system looks for libraries, and even LoadLibraryEx which accepts flags to further control this.
Frankly, this is the sort of task where I think ChatGPT or some other LLM can help you out reasonably well.
18 replies
Docker-compose volume storing image
Not sure I'll be able to follow up if you answer, but just to get the obvious things out of the way so that it may help others:
- if you
docker exec -it apitest.api ls /unfiltered_images
can you see the actual files?
- if you docker exec -it apitest.api touch /unfiltered_images/chicken.png
, can you then see the file?
EDIT to add: the indentation in the compose file seems to be a little off for the volume, yaml can get a little weird, I'm guessing it should give you an error but it's probably worth it to fix it and try again, unless it's just a copy-paste gone wrong.
EDIT on top of the edit: if your app is running as user app
, you could add -u app
before -it
in those docker exec
commands, otherwise you're likely to execute them as root, I think.7 replies
Which Architecture to Choose?
Another opinion. What volume of incoming calls are you expecting? Just because you can, it doesn't mean you should necessarily decouple the consumer into its own external process right away.
If I didn't already have reasons to believe the system will get absolutely hammered by requests, I'd personally go for a BackgroundService.
As for polling the database, you can get rid of any problem with empty reads (and by that I mean querying and coming up empty handed because there's nothing to do) or ridiculously short polling intervals by using Redis or any of its forks as a message broker with its pub/sub pattern.
Check out:
- https://stackexchange.github.io/StackExchange.Redis/Basics#using-redis-pubsub
- https://redis.io/docs/latest/develop/interact/pubsub/
- https://stackexchange.github.io/StackExchange.Redis/PubSubOrder
Doing things this way, you know exactly when you have something to do and avoid bothering the db. It's also a matter of how fast you need the results and how long the processing takes. If the processing itself doesn't take very long and messages don't have to be processed the second they come in, a tiny SELECT every few seconds is probably not going to kill anyone.
I say, keep it simple unless you already know the traffic will be crazy, or if the processing has to carry on no matter what even if the main app goes down. If it does become crazy, it's then fairly trivial to move the BackgroundService class and make it its own app (without changing anything, because you're using Redis anyway: as long as the machine where you put the consumer can access the same Redis instance, you're golden. Things do change if you already know you're gonna need multiple consumers).
Do note that, if you really want to use Kafka, you can still go for an in-process consumer, and move it out-of-process should you need to.
51 replies
Microsoft Authentication in an iframe
This is just an idea, but assuming you have control over both apps, have you considered passing what you need via postMessage in JavaScript?
https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
be sure to read about the security implications, of course, even if it’s an internal app.
2 replies
Scaffold item error
Hmm, that link takes you to a page suggesting to download the .NET 8 runtime, not the SDK which, if you're here, I'm guessing you need (and is this one: https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/sdk-8.0.404-macos-arm64-installer)
What command are you trying to execute, and if it begins with
dotnet
, does adding --roll-forward LatestMajor
do anything for you?
Deleting all the bin
and obj
directories might help too.14 replies
Manage small university project
Not trying to be snarky or condescending, but when asking questions about programming, people expect you to:
- try to implement what you're after
- when something fails, do you own research (including looking at StackOverflow answers and reading the documentation—a good idea no matter what, because if you don't you might gloss over some really important remarks detailing behavior you would otherwise not know about)
- when your own research is fruitless, post
But when you do post, make sure you take your time and craft a good question.
Hi, I'm trying to do X because I need to do ABC, and here's how I tried to do it:
Instead of doing X it does Y/an exception is thrown at line 42, what am I doing wrong? If I try doing Z/commenting out these lines of code it works as intended. According to the docs at https://example.com/learn/thing, this should work.As an example, you mention you know what events are but not how to implement them (but really, when it comes to events you talk about subscribing/unsubscribing from them, if you want to use the correct lingo). What exactly is not clear when you read this page of the documentation? https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/events/how-to-subscribe-to-and-unsubscribe-from-events If what you're after is a code review for a larger chunk of code, there's the #code-review channel and other places on the Internet. But I doubt that's your case, since you don't seem to know how to handle events yet, so by definition you don't have a finished/semi-finished piece of code to show. Lastly, remember that when you ask for help on the Internet you're asking for people to spend some of their free time on you. Help them help you, or it's going to be frustrating for everyone involved.
23 replies