Let's say I got projects A, B and C. Project A references projects B (v. 2.0.0.0) and C (v. 3.0.0.0). Project B references only project C (v. 1.0.0.0). We got a conflict on our hands, since project A and B depend on different assembly versions of project C. In .NET framework we solve this issue using binding redirects. In Project A's app.config
file (being the main project) we add:
<dependentAssembly>
<assemblyIdentity name="C"
publicKeyToken="<somePublicKeyToken>"
culture="en-us" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
I believe that binding redirects are no longer a thing in .NET Core and .NET 5 forward. Instead of referencing an assembly, we reference a NuGet package or a project. My question is: how is this issue solved in newer version of .NET? Why were binding redirects a thing in the first place? Hope my question makes sense.
csc
compiler still generates your.exe
/.dll
files with good ol' fashioned assembly-references inside of it. And you can still do manual assembly references from .NET Core / .NET 5+.csproj
projects too - it's just kinda buried. – Unbraid