question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using DocumentDB nuget package with ASP.NET core doesn't work.

See original GitHub issue

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 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:closed
  • Created 7 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
wattengardcommented, Sep 22, 2016

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.

0reactions
aspnet-hellocommented, Dec 30, 2017

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found