Skip to content

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.

Published inUncategorized