I am working on a complex migration to .NET Core 6 application which has a set of shared assemblies which are located in a different path than the main application assemblies due to our deployment strategy.
The libs are statically linked so I can't use AssemblyLoadContext
or AppDomain
to extend the resolving process, sadly. I saw that the runtimeconfig.json
offers the possibility to add APP_PATHS
which seem to work, BUT I only managed to use absolute paths - which is nonsense as I won't know the actual paths on the target machines.
Can't I use relative paths? Whenever I try even sub-paths I get an exception that the runtime cannot be created. Is there a magical syntax to that? It can't be so complicated to have the assemblies in multiple folders.... I feel stupid.
Has somebody an idea here? I can't just change the deployment structure / process.
Thanks
Update: After carefully subscribe to AssemblyLoadContext.Default and ensuring that only that happens in the static main, not some static constructors interfering, it works. Thanks for the heads up.
An example to my comment. I have three projects: Library
A
, LibraryB
, and ApplicationC
.A.csproj
andB.csproj
ClassA
in projectA
.ClassB
C.csproj
Program.cs
I structured my output as follows
Program output: