C
C#2y ago
WaffleDevs

❔ How would I have a compiled Class Library look for necessary reference in a folder other than ./

I am creating a game mod via Melon Loader, and I want to have the compiled .dll look for its references in a different folder than where the .dll is in. How do I do this?
7 Replies
JakenVeina
JakenVeina2y ago
I know there's an official MS docs page that describes this, but I found this blog first
JakenVeina
JakenVeina2y ago
Michael's Coding Spot
Understanding How Assemblies Load in C# .NET
We are constantly dealing with libraries and NuGet packages. These libraries depend on other popular libraries and there are a lot of shared dependencies. With a large enough web of dependencies, you'll eventually get into conflicts or hard situations. The best way to deal with such issues is to understand how the mechanism works internally.
JakenVeina
JakenVeina2y ago
specifically, item #5, under "Assemblies Binding in .NET" ah, here we go
JakenVeina
JakenVeina2y ago
How the Runtime Locates Assemblies - .NET Framework
Learn how the common language runtime (CLR) locates and binds to the assemblies that make up your application in .NET.
mtreit
mtreit2y ago
My advice would be: don't. What do you gain by this setup?
WaffleDevs
WaffleDevsOP2y ago
Cleaner mods folder and a centralized location for mod reference dlls.
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server