Using DocumentDB nuget package with ASP.NET core doesn't work.
See original GitHub issueI just added the Microsoft.Azure.DocumentDB package to my ASP.NET Core project and everything stopped working. I now get a 500-error at boot saying it can’t find version 9.0.0 of Newtonsoft.Json. I can understand this, as the binary being copied to the bin-folder is version 6.0.8, which the DocumentDB package has a dependency on. But why does it stop my previously working app from running?
System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Using DocumentDB nuget package with ASP.NET core doesn't ...
I just added the Microsoft.Azure.DocumentDB package to my ASP.NET Core project and everything stopped working. I now get a 500-error at boot saying...
Read more >DocumentDb Identity Provider for ASP.NET Core
The Microsoft DocumentDB native .Net client does not support .Net Core; so, you must configure ASP.Net Core to target the 'full' .Net Framework....
Read more >Using Azure DocumentDB and ASP.NET Core for extreme ...
NET Core, we will use the project.json to define dependencies. We will only need the Azure DocumentDB Nuget package on the latest version:...
Read more >Azure Function Portal C# Script cannot fetch nuget ...
I'm developing a windows Azure Function App in the portal.azure.com. This C# script runs... However, if I remove the first comment, ...
Read more >Microsoft.Azure.DocumentDB.Core 2.20.0
This client library enables client applications targeting .NET Core to connect to Azure Cosmos DB via the NoSQL API. Azure Cosmos DB is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Oh. I forgot all about this.
I solved it, but it wasn’t quite straight forward to find out. I had a data repository project that I added the Microsoft.Azure.DocumentDb package to. However, instead of installing the newest Newtonsoft.Json (9.0.1) it installed the minimum requirement (6.0.8). And this version was copied to the output directory and somehow screwed up the web-project.
After I deleted all references to both Microsoft.Azure.DocumentDb and Newtonsoft.Json from both projects, then added Newtonsoft.Json to the repo-project, and then the Microsoft.Azure.DocumentDb package, then everything works again.
This issue is being closed because it has not been updated in 3 months.
We apologize if this causes any inconvenience. We ask that if you are still encountering this issue, please log a new issue with updated information and we will investigate.