3

I have an ASP.Net project which has several sub projects referenced.

I decided today to update some of my nuget packages to have newer versions, what a mistake it was.

Now when I try to debug my app I get this exception:

System.IO.FileNotFoundException: 'Could not load file or assembly 'Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.'

InnerException : FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.

It seems like it's looking to load 6.0.0.0 which is not referenced by any of my subprojects, maybe one of the other nugetpackages ?

I've followed several questions here to perform different operations including: - Deleting packages folder in Windows Explorer - Reinstalling the Newtonsoft.Json package - Clearing the cache of the package in the settings of VS - Restoring the packages - Cleaning my solution - Restarting VS

I'm using VS 2017 community.

I tried to update several other packages to see if it could be linked and I got many new exceptions so I just decided to stop the mess and rollback everything.

But the problem is still here after the rollback so i'm really unsure about what I should do now.

Links I've checked before: Nuget package installed but references not resolved https://learn.microsoft.com/en-us/nuget/consume-packages/package-restore-troubleshooting

user2088807
  • 1,378
  • 2
  • 25
  • 47
  • Delete "packages" folder completely from the solution root. Check nuget packages on a solution level ("Manage Nuget packages for Solution..."), maybe you have different versions of the same package installed for different projects. Uninstall remaining packages manually. Reinstall them from the repository. – scor4er Apr 09 '19 at 15:08
  • Have you checked Newtonsoft.Json version in each of project's packages.config file? – Khatri Karan Apr 09 '19 at 15:06
  • Thank you for your messages. However it didn't work. I've checked and they all have the same Newtonsoft.Json version (10.0.3). Maybe an other package is using an old version? – user2088807 Apr 17 '19 at 11:04
  • The innerexception is looking for the version 6.0.0 for some reason. – user2088807 Apr 17 '19 at 11:12

0 Answers0