C#C
C#4y ago
Davide

Share static variables between projects to build WebAPI

So, I already searched on google but couldn't find anything. I have two projects, one is a discord bot, the second one is a WebAPI project to interact with the bot via Web. However i need some instances of some classes in the WebAPI project to retrieve/send informations.

I read about DLLs sharing static stuff but having the WebAPI running on another process (IIS Server), the context isn't shared so it's like a brand new one, pretty useless.

Possible solution: Named pipes / MemoryMappedFile, but that would mean more code in the bot to continuously update the values of the variables + serialization + possible desync (?)

Is there any way to integrate WebAPIs in the same "scope" of the main application?

Thank you.
unknown.png
Was this page helpful?