I have a Blazor webassembly solution (hosted by aspnet.core webapi) which builds and runs fine locally. Server and Client reference directly newtonsoft.json.dll version 13.0.1. The server also has a reference to Microsoft.AspNetCore.Mvc.NewtonsoftJson which shows a dependency to newtonsoft.json of >=12.0.
If after compiling I search locally in the bin folders, ALL projects have version 13.0.1 but one 12.0.3 in the BlazorDebugProxy folder.
Now building,publishing and running the app via azure results in error:
Could not load file or assembly 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'. The system cannot find the file specified. File name: 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' at Microsoft.AspNetCore.Mvc.MvcNewtonsoftJsonOptions..ctor()
Looking at the files in the artifacts which the build created, it is version 9.0.1 ! The only hint why this file might be the wrong version is that this is the Net Standard 1 version. However the projects all have version 5 in their csproj files, so it should not pull any framework 1 stuff and it does not locally.
I added a step to install Net 5 SDK and when starting the restore process it correctly reports that SDK version 5.0.402 is used.
In the pre Net Core world such issues where easily resolved with an assembly rebind, what do I do now ?