1

I'm currently developing a series of applications for our local company. In order to normalize things as much as possible, I've created a "core" library that will handle all of the commonly used functions (report creation, FTP, database execution, etc.) However, in order to create my core library, I have to reference a slew of other (3rd-party) libraries, such as Npgsql.dll, Newtonsoft.Json.dll, various CrystalDecisions libraries, and others.

At present, for every new application I build, I'm copying ALL of the libraries - including my own core library - into individual executable folders on our network. This works for our environment because these applications are only ever intended to be used internally.

However, for the sake of simplicity, I'd like to have all of the 3rd-party libraries accessed from a central repository. I'm not as concerned about my core library, but with the number of 3rd-party libraries I'm using, it can get a bit confusing - especially if just one of those libraries is out of date in the specific application's executable folder.

Is there a "best practice" for this type of situation? I've glanced at some information regarding the GAC, but I'm not 100% sure how I would make it work in this scenario. Any advice or suggestions would be greatly appreciated.

G_Hosa_Phat
  • 976
  • 2
  • 18
  • 38
  • [How to load an assembly at runtime that is located in a folder that is not the bin folder of the application](https://support.microsoft.com/en-us/help/837908/how-to-load-an-assembly-at-runtime-that-is-located-in-a-folder-that-is) – TnTinMn May 02 '19 at 23:43

1 Answers1

1

One solution would be to register the DLLs on the host machine so they no longer need to be present in the file system.

You could also merge assemblies to reduce the total number of them you need to copy.

Either can be a bit of a pain, I typically just copy the DLLs as you've mentioned. Having them in the file system makes it much easier to swap one out when something gets updated. Interested in hearing other solutions though...

Jacob M.
  • 750
  • 1
  • 6
  • 21
  • The merging of assemblies with ILMerge might be the solution I'm looking for. Although, as you said, I could see it being a bit of a pain if one of the 3rd-party libraries gets updated. Personally, I'd LOVE to have all of the libraries in a centralized network share, then just let my core library and the application refer to those copies, but I've not been able to find a legitimate and/or reliable way to accomplish that. – G_Hosa_Phat May 02 '19 at 21:46
  • You could try putting the DLLs in a network share and just replacing the DLLs in the folder with shortcuts. I have no idea if this would work, but its worth a shot. – Jacob M. May 02 '19 at 21:48