I have two different projects and both use Newtonsoft.Json from NuGet.
- Project A uses the version 9.0.1.
- Project B uses the version 11.0.1.
When building the projects, one dll is overwriting the other dll, because they are both being compiled in the same folder.
How can I redirect the compilation for the dll's in seperate files and how can I say that Project A uses 9.0.1 and Project B uses 11.0.1?
It would be great to have a folder "Newtonsoft" and there are 2 folders "11" and "9". In those folders are the specific versions. (If there's another solution, then I'm also fine with the other one).
Project A and Project B are both "Plugins", which are being used by an application by me, which includes those plugins from a Plugin-Folder.. This means I currently have an application which uses the following dll's (they are all in one folder):
- Project_A.dll
- Project_B.dll
- NewtonSoft.Json.dll (either 9.0.1 or 11.0.1)
ProjectA.dll
This is my app.config
Project A:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="YamlDotNet" publicKeyToken="ec19458f3c15af5e" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Project B:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" />
<codeBase version="11.0.0.1" href="Newtonsoft.Json.dll" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /></startup></configuration>