© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
5 replies
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
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Referencing between Two Projects
C#CC# / help
3y ago
❔ Circular dependency between projects
C#CC# / help
3y ago
❔ Circular dependency between projects
C#CC# / help
3y ago
shared variables between actions
C#CC# / help
4y ago