Dynamically load API Controllers ASP.NET

So i was thinking of a concept that allows me to seperate my controllers from the main application in ASP.NET The way it would work is that i can make some sort of DLL/Library file for specific controllers and put them into a folder along with the main program which then load as controller for example Main App -> APIController.dll : contains /api/ -> ServiceController.dll : contains /service/ and so on TLDR; How to make APIControllers load dynamically as DLL files if possible
41 Replies
Omnissiah
Omnissiah12mo ago
a bunch of people asked for this recently https://learn.microsoft.com/en-us/dotnet/api/system.reflection.assembly.loadfrom?view=net-8.0 it's something i wanted to try too, honestly
MODiX
MODiX12mo ago
Kowalski
<@347434717022257162> Okay i figured it out. Apparently if i wanna use controllers from a different assembly, i need to add them as "ApplicationParts" like this
From Kowalski
React with ❌ to remove this embed.
Unknown User
Unknown User12mo ago
Message Not Public
Sign In & Join Server To View
The Fog from Human Resources
I mostly want to do it for the sake of being able to update more flexibly
Unknown User
Unknown User12mo ago
Message Not Public
Sign In & Join Server To View
MODiX
MODiX12mo ago
dotnet
YouTube
Vertical Slice Architecture: How Does it Compare to Clean Architect...
Is Vertical Slice Architecture the next big thing or just as cool new kid? Enterprise software development requires you to choose the right architecture. This session with Luke Parker will provide a realistic dive into Vertical Slice Architecture (VSA) with .NET; showcasing the potential shift from Clean Architecture (CA) to VSA. You will lear...
Derek Comartin
CodeOpinion
Restructuring to a Vertical Slice Architecture
What is Vertical Slice Architecture? It's about focusing and organizing code by features and capabilities, not technical concerns!
The Fog from Human Resources
Imagine if I want to add a new feature and suddenly need to make an urgent patch
Unknown User
Unknown User12mo ago
Message Not Public
Sign In & Join Server To View
The Fog from Human Resources
Hm Would still be nice for a multi service backend
Unknown User
Unknown User12mo ago
Message Not Public
Sign In & Join Server To View
The Fog from Human Resources
Pretty much
Unknown User
Unknown User12mo ago
Message Not Public
Sign In & Join Server To View
The Fog from Human Resources
I mean reverse proxy and all is fine I did that before I just think if I want to add more stuff I'd rather have it dynamic
Unknown User
Unknown User12mo ago
Message Not Public
Sign In & Join Server To View
Unknown User
Unknown User12mo ago
Message Not Public
Sign In & Join Server To View
The Fog from Human Resources
Talking about git I use a method called feature branching so every new feature gets a branch that gets merged into dev branch and then eventually into release branch If something is merged into dev branch my feature branch won't be updated cause it's not dev and then I need to rebase Since I couldn't test it yet, will rebasing my code to dev branch delete my new feature code?
Unknown User
Unknown User12mo ago
Message Not Public
Sign In & Join Server To View
The Fog from Human Resources
Once. But I just changed 1 line in a readme
Unknown User
Unknown User12mo ago
Message Not Public
Sign In & Join Server To View
The Fog from Human Resources
I mean no
Unknown User
Unknown User12mo ago
Message Not Public
Sign In & Join Server To View
The Fog from Human Resources
But I'm not sure what happens to files that have been updated in the previous merge
Unknown User
Unknown User12mo ago
Message Not Public
Sign In & Join Server To View
Unknown User
Unknown User12mo ago
Message Not Public
Sign In & Join Server To View
The Fog from Human Resources
Thing is that I only ever used git as a solo developer and I only had my dev and release branch so far But I'm slowly starting to develop in smaller teams and figured feature branching might be a good approach
Unknown User
Unknown User12mo ago
Message Not Public
Sign In & Join Server To View
The Fog from Human Resources
Ah Yes
Unknown User
Unknown User12mo ago
Message Not Public
Sign In & Join Server To View
Omnissiah
Omnissiah12mo ago
the only tool that will avoid difficult commit conflicts is organizing the work beforehand
Unknown User
Unknown User12mo ago
Message Not Public
Sign In & Join Server To View
The Fog from Human Resources
Yes yes
Unknown User
Unknown User12mo ago
Message Not Public
Sign In & Join Server To View
The Fog from Human Resources
A rebase is done typically before beginning the work This way it's always up to date
Omnissiah
Omnissiah12mo ago
if you have setup a webhook that notices you when other people commits it's good if not you just try to fetch before a commit
The Fog from Human Resources
Anyways I'll try to figure out a way for my original message later and also take a look at feature slicing We do I never do anything without those webhooks they are wonderful
Unknown User
Unknown User12mo ago
Message Not Public
Sign In & Join Server To View
Unknown User
Unknown User12mo ago
Message Not Public
Sign In & Join Server To View
The Fog from Human Resources
I mean this
Want results from more Discord servers?
Add your server