C
C#15mo 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
JakenVeina15mo ago
I know there's an official MS docs page that describes this, but I found this blog first
JakenVeina
JakenVeina15mo 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
JakenVeina15mo ago
specifically, item #5, under "Assemblies Binding in .NET" ah, here we go
JakenVeina
JakenVeina15mo 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
mtreit15mo ago
My advice would be: don't. What do you gain by this setup?
WaffleDevs
WaffleDevs15mo ago
Cleaner mods folder and a centralized location for mod reference dlls.
Accord
Accord15mo 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
More Posts