Search code examples
c#axaptadynamics-ax-2012x++dynamics-ax-2012-r2

How to get references from C# project to deploy with AX?


I've created a C# class as a wrapper to call a Json rest webservice that will be used in AX, and have added my C# project to AX and can see/reference the methods.

In my C# class, I'm using Newtonsoft.Json (Json.net) as a reference to help serialize/deserialize the Json string and I receive this error:

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

I added it to the GAC and restarted the AOS with the same error. Is there a way to force dependent references to deploy with the project?

On the project I have Deploy to client = Yes and Deploy to Server = Yes.


Solution

  • Dependency folder copy the dll there reference it there as well as add to then reference node from the dll in the Dependency folder.. then change the Copy Local=false to Copy Local = true on the properties of the dll when looking at it from the references

    also

    Make sure that you remove the reference from the references node then re-add it browsing to the Dependency folder