0

I have two ASP.NET Core apps running on the same server and they share many dependencies.

I want to put all these common dependencies in a directory in order to save disk space. But I don't know how the config the apps needs to be so they search this particular directory in order to load them.

Thanks in advance

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • Can you share with us some extra pieces of information? .Net core app types? Versions? How is the server? Are you using a container or classic physical server? OS type? – Kadir Alan Feb 24 '21 at 05:25
  • They are two web apps runing on a virtual private server with ubuntu using apache as reverse proxy. – Manolo Valdés Feb 24 '21 at 13:57
  • they no use any container. just deployed to a folder with visual studio publish wizard. – Manolo Valdés Feb 24 '21 at 14:26
  • netcore varsion 3.1 – Manolo Valdés Feb 24 '21 at 18:38
  • This sounds like a beginner's mistake. Disk space is extremely cheap, and developer time is not. It isn't that this is particularly hard to do it - it's that you have to do it and maintain it into the future. – GlennSills Feb 25 '21 at 13:42
  • Disk space may be cheap, but not for me. any way seems to be marked driven limitation for net core. to have lots of files duplicated in my file systems seems to be a waste for my point of view. tecnical solution will be appreciated – Manolo Valdés Feb 25 '21 at 16:18
  • For now i used a sys admin trick. Making syslink for the common libs . This way severals mbytes were saved from my virtual private server. – Manolo Valdés Feb 26 '21 at 02:57
  • this should be easy if you host your apps using Windows (with support of GAC - so you can put all shared dependencies in GAC) or using docker (with support of accessing the host resources via shared volumes or shared folders). I agree that if you restructure your apps based on layers (or even tiers), you can reduce the number of shared dependencies between layers, e.g: there is just one app for UI/View (web layer), all services are served by another app (web api) ... Of course that's an initial big decision and may not be applicable in your current scenario. – King King Feb 28 '21 at 19:11

1 Answers1

0

As far as I can see, there is conceptual complexity and misunderstanding here. Before I explain this, I would like to inform you that go over some assumptions. There are only 2 web applications(could be API projects or different). I assume you don't have any projects. I have already asked you.

Dependencies are a big problem throughout the development process. And we developers are responsible handle this. Evolve the Tightly-Coupled systems to Loosely-coupled system gives us many advantages. For this reason, we aim to reduce the dependencies of the applications by using many technics, design patterns throughout the development process. I recommend you looking for dependencies and coupling concepts. I share some information that will be a starting point for you.

After looking for it, you will become aware that you need to separate dependencies at the application level rather than at the disk level. You will find that have many technic and approach. I am sure that after looking it for you take action will be easy.

Here are points;

https://dev.to/franiglesias/dependencies-and-coupling-4365

https://stackify.com/dependency-inversion-principle/

What is the difference between loose coupling and tight coupling in the object oriented paradigm?

Kadir Alan
  • 209
  • 1
  • 13
  • Thanks for the links. But maybe i did not express my problem clear. In this case my two apps use many of the same dependencies. Like send email service, devexpress framework (many mega bytes), and many others. So it looks for me a valid approach to put all this common deps in a shared dir. My virtual private server is running out of disk space due this. So maybe an enviroment var like path can solve this. But looking in the netcore docs have been pointless for me. Thanks for all guys – Manolo Valdés Feb 28 '21 at 17:26