8/24/2017

How to add .dll file into AX 2012

When I was trying to add a .dll into AX 2012, I could not find a document how to do that. After many testings I did, eventually, I figured out how it works. Basically, this post is for those developers who have not used .dll in AX 2012. Hope it could help them understand how to do it.
I found that to let AX use the .dll we need to,

1. Let AX know that .dll, so we can compile the code.

  • Add reference



















If the .dll is already added to GAC on the client machine, we can select it from the assembly list. Otherwise, we'll need to select the .dll file by browsing the file.

  • If .dll is not in GAC on the client machine, we additionally need to copy the .dll file to the client/bin folder and restart the client so we can compile the code which consumes the .dll. 


2. Let AX be able to find the .dll to consume it.

  • If the code is run at server side, we need to make sure the .dll could be correctly consumed. So we need to either add that .dll to GAC on the server machine or add it to server/[InstanceName]/bin folder and restart the AOS.
  • If the code is run at client side, we need to do the same to the client machine.


Once we've done above, the .dll should be able to be called by AX 2012.