Reputation: 1769
My project uses a modified version of the Newtonsoft.Json library with some changes so that it will play nice with AOT. The modified dll has been added as reference assembly of the project. My project also uses a set of additional libraries (some via Nuget, some via additional project includes), and some of these libraries also have their own dependency on Newtonsoft.Json.
Upvotes: 1
Views: 737
Reputation: 63
It should be possible to make external libraries load your dll using AppDomain.CurrentDomain.AssemblyResolve
AppDomain.CurrentDomain.AssemblyResolve += (s, a) => { if (a.Name.Contains("Newtonsoft.Json")) return Assembly.LoadFrom(@"PATH TO YOUR DLL HERE"); else return null; };
In case of web application you can get the path to your dll using Server.MapPath
Upvotes: 1