Advice needed: NewtonSoft.Json and Dynamics NAV 2009 R2 Classic

950 Views Asked by At

I'm trying to get the Codeunit 50000 in this zip file to work: https://kappiwebhosting.blob.core.windows.net/dynamcisis/2015/09/Json.zip Found here: https://dynamics.is/?p=2303

C/AL Globals

I'm trying to get Dynamics Nav 2009 to recognize the NewtonSoft.Json.dll, but no matter which version i try, i get this error as soon i want to verify the DotNet variable "JsonTextReader"/"JsonTextWriter" when selecting the subtype.

.NET interop: exception occured, 'Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.'.

If i declare a new Test variable of type DonNet and click [...] to select it from scratch i got this error when trying to choose which assembly to use:

.NET interop: exception occured, 'Could not load file or assembly 'C:\Program Files (x86)\Microsoft Dynamics NAV\60\Classic\Add-ins\Newtonsoft.Json.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.'.

The Newtonsoft.Json.dll file is present ind the folder, and "Everyone" have full control to the folder as well as the file.

The Json.zip file contain a single Newtonsoft.Json.dll which i started out with. Same error. The i downloaded the https://github.com/JamesNK/Newtonsoft.Json/releases and tried all versions with the same result.

Why all this? Yes, the company i work for have decided to start using Shopify, and i need to write an interface for getting orders from Shopify etc.

I really cannot figure out why i can't get this to work. There are 3 other DotNet "variables" that's configured and works as intended with no errors.

So any advice is highly appreciated.

Thanx

0

There are 0 best solutions below