Skip to main content

Notifications

Microsoft Dynamics AX forum
Answered

Adding dll and using it in code

Posted on by 108
Hi,
 
I am trying to use Newtonsoft.Json dll in my code. i have coppied the dll file to the bin folder.
I have also added it in refrences in AOT.
 
But still if I try to use it in my class, it does not reognize th dll and throw an error that /Newtonsoft is not declared/.
Can you help me out in this situation?
 
  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 225,189 Super User on at
    Adding dll and using it in code
    .NET Framework 4.0. You can find that in AX 2012 System Requirements.
  • ShahzaibAhmed52 Profile Picture
    ShahzaibAhmed52 108 on at
    Adding dll and using it in code
    What would be the version for R2?
  • Martin Dráb Profile Picture
    Martin Dráb 225,189 Super User on at
    Adding dll and using it in code
    Well, where did you get the file from? You should have selected it there or when extracting the package, if it contains binaries for several framework versions. For example, the latest package from https://github.com/JamesNK/Newtonsoft.Json/releases contain these folders:
     
     
    It's also possible to explore the content of the file, but just getting the right one is easier.
     
    Assuming you're on AX 2012 R3, use the assembly for .NET Framework 4.5.
  • ShahzaibAhmed52 Profile Picture
    ShahzaibAhmed52 108 on at
    Adding dll and using it in code
    How can I know that dll is the right version?
     
    Currently, I am using v6.0 for the Newtonsoft.

    I am working for the first time on ax 2012 so I don't have any idea about it.
  • Martin Dráb Profile Picture
    Martin Dráb 225,189 Super User on at
    Adding dll and using it in code
    Is the DLL for the right version of .NET Framework?

Helpful resources

Quick Links

Community Spotlight of the Month

Kudos to Mohamed Amine Mahmoudi!

Blog subscriptions now enabled!

Follow your favorite blogs

TechTalk: How Dataverse and Microsoft Fabric powers ...

Explore the latest advancements in data export and integration within ...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 283,907 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,189 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,146

Featured topics

Product updates

Dynamics 365 release plans