How to Fix the Error in Dynamics 365 : ‘A Reference Is Required to Compile This Module'

One of the most common errors developer may faced while building a project is the reference required error. It’s something like:


Error: A reference to 'Dynamics.AX.Directory, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' is required to compile this module.




Error: A reference to 'Dynamics.AX.ApplicationFoundation, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' is required to compile this module.




Error: A reference to 'Dynamics.AX.ContactPerson, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' is required to compile this module.




Error: A reference to 'Dynamics.AX.SourceDocumentation, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' is required to compile this module.




Error: A reference to 'Dynamics.AX.Retail, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' is required to compile this module.



Error: A reference to 'Dynamics.AX.FiscalBooks, Version=0.0.0.0, Culture=neutral, 
PublicKeyToken=null' is required to compile this module.

In above all the errors , I am highlighting the text in bold just because you may have some idea about which model is missing and required to add in your current model.

This error indicates we’re trying to modify/reference code from a model (Directory, ApplicationFoundation, ContactPerson, SourceDocumentation ) other than the current model and a reference isn’t set up between the two. To fix this error, 

navigate to Dynamics 365 > Model Management > Update model parameters.





Now click Next and select the model that needs to be referenced. In my case i am adding SourceDocumentation model like below.
Once all the related models are selected, click Next and rebuild your project and check.
Previous
Next Post »

2 comments

Write comments
Unknown
AUTHOR
14 September 2018 at 02:57 delete

Thanks for helping me!

Reply
avatar
21 February 2023 at 04:25 delete

Thanks for sharing this informative article on How to Fix the Error in Dynamics 365. If you have any requirement to Hire MS Dynamics CRM consultant to accelerate your company's success by evaluating new solutions and customizing existing ones with Microsoft Dynamics. Please contact us.

Reply
avatar