web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Problem with cross reference update in Dynamics AX 2012

(0) ShareShare
ReportReport
Posted on by 130

Hello everyone,

Can anyone help me solve a problem that has arisen during the update of the cross-reference in Dynamics AX 2012. After running the script

static void CrossRefUpdateBatch(Args _args)
{
    ;

    xRefUpdate::truncateXrefTables();
    xRefUpdateIL::updateAllXref(true, false, true);
    info("Done, cross reference update batch job created.");
}
, the following errors have occurred:

  • Unable to generate cross reference information for assembly: Microsoft.Dynamics.Ax.Tms.dll
  • Unable to generate cross reference information for assembly: Microsoft.Dynamics.AX.Framework.Tools.CodeUpgradeTool.Parser.dll
  • Unable to generate cross reference information for assembly: Microsoft.ApplicationInsights.dll
  • Unable to generate cross reference information for assembly: Microsoft.Dynamics365.XppSupportLayer.dll

The error occurs on line 107 in the script (\Classes\xRefAssemblyReferences\updateXrefAssembly)

/// 
///    Identifies references to AOT elements from an assembly that is registered under AOT References.
/// 
/// 
///    A tree node for the assembly to inspect.
/// 
/// 
///    The name of the assembly to do cross reference over.
/// 
/// 
///    The path where the assembly is located.
/// 
/// 
///    Boolean whether the assembly can stay loaded after cross reference is ran over.
///    Example: VS Projects need the assembly to be unloaded to be updatable if code changes are made.
/// 
public static void updateXrefAssembly(TreeNode _treeNode, str _assemblyName, str _assemblyPath, boolean _loaded = true)
{
    Microsoft.Dynamics.AX.Framework.CrossReference.ReflectorHost reflectorHost;
    Microsoft.Dynamics.AX.Framework.CrossReference.Reflector reflector;
    Microsoft.Dynamics.AX.Framework.CrossReference.Reference reference;
    str referedElementName;
    int xrefReferedElementType;
    int operationType;
    int line;
    int column;
    int parentType;
    int parentId;
    str parentName;
    str source;
    boolean moreReferences;
    int numberOfReferencesFound;

    try
    {
        //If the assembly is not loaded - Create AppDomain to be able to unload assembly after cross reference performed.
        if (!_loaded)
        {
            //BP Deviation Documented
            reflectorHost = new Microsoft.Dynamics.AX.Framework.CrossReference.ReflectorHost();

            //Create the reflector object through host passing in the client bin path
            reflector = reflectorHost.startDomain();
        }
        else
        {
            //BP Deviation Documented
            reflector = new Microsoft.Dynamics.AX.Framework.CrossReference.Reflector();
        }

        // Identify the list of references
        reflector.findReferences(_assemblyPath   _assemblyName);
        numberOfReferencesFound = reflector.numberOfReferences();

        // Store the references
        if(numberOfReferencesFound > 0)
        {
            do
            {
                reference = reflector.nextReference();
                reference.getValues(byref referedElementName,
                                    byref xrefReferedElementType,
                                    byref operationType,
                                    byref line,
                                    byref column,
                                    byref parentType,
                                    byref parentName,
                                    byref source);

                switch(parentType)
                {
                    case UtilElementType::Table:
                        parentId = tablename2id(parentName);
                        break;
                    case UtilElementType::Class:
                        parentId = classname2id(parentName);
                        break;
                    case UtilElementType::Enum:
                        parentId = enumname2id(parentName);
                        break;
                }

                _treeNode.AOTaddXref(referedElementName,
                                     xrefReferedElementType,
                                     line,
                                     column,
                                     operationType,
                                     parentId);

                moreReferences = reflector.more();
            }
            while(moreReferences);
            _treeNode.AOTendXref();
        }
        // Unload AppDomain. This will unlock any assemblys loaded during xRef.
        if(!_loaded)
        {
            reflectorHost.unloadDomain();
        }
    }
    catch
    {
        if(!_loaded)
        {
            reflectorHost.unloadDomain();
        }
        error(strfmt("@SYS320347",_assemblyName));
    }
}

Can anyone help me get rid of these errors and explain why they are occurring?

Thank you in advance for your help!

I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 646 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 529 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans