SSRS Reports - AX 2012 - Could not load assembly Metadata.AX version 6.0

Doing an upgrade from AX 2012 R0 to AX 2012 R2 and receiving the following error:
Error while setting server report parameters. Error message: Failed to load expression host assembly. Details: Could not load file or assembly 'Microsoft.Dynamics.Framework.Metadata.AX, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. (rsErrorLoadingExprHostAssembly).

This error can actually appear at two different moments: when running the report from AX or when you are actually trying to redeploy the report from AX to SSRS.
If you find yourself in the first case, for sure in this case you have forgotten one thing: to redeploy the reports, because of course their current definition on SSRS is holding references to some R0 versioned files.
However, if you are in the second scenario (and redeploying does not work for some), make sure you update their references to the R0 files. You can do this by changing directly the xpo files (look for 6.0. texts and replace them with the text you can take from any working report  you have exported as xpo - I did most of them like this) or as Peter was mentioning below (thanks Peter for your comment) just open for edit the report in Visual Studio and deploy.
Still, the second scenario implies that you might also customized them; in this case you will need to perform a merge of course, and more on this is still to come ... no helpful conclusion yet.

If you are interested in changing the text file directly you are looking for this:

#<Reports Version="6.0.14.0">

#    <CodeModule>Microsoft.Dynamics.Framework.Reports, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35</CodeModule>
#    <CodeModule>Microsoft.Dynamics.Framework.Metadata.AX, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35</CodeModule>

to replace with:

 #<Reports Version="6.2.15.0">

#    <CodeModule>Microsoft.Dynamics.Framework.Reports, Version=6.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35</CodeModule>
#    <CodeModule>Microsoft.Dynamics.Framework.Metadata.AX, Version=6.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35</CodeModule>




6 comments:

  1. Thank you for the info.

    What's in your opinion the best way to merge the SSRS reports? We can't meaningfull compare report layers..

    In case you've added an additional design, the old standard design maybe won't compile. Also new report designs will probably lead to errors in code when using ssrsReportStr().

    So remove all modifications and bring them back on? Is there some easy way to do this using a text editor or something?

    Kind regards

    ReplyDelete
  2. Hi.

    Glad to be helpful.
    Regarding the way to upgrade R0 to R2 SSRS reports I haven't come yet to a satisfying solution. Bringing back into the R2 version the changes done on R0 using a text editor is quite difficult because of the noise you found in the .xpo file and I haven't found yet a good editor to take on this task. I am exploring some other options (copying the entire design in VS is one, but this can lead to other issues). If I find anything worth mentioning I will post it for sure in the next few days.

    Thanks.

    ReplyDelete
  3. Rebuild the AX Visual studio report projects in visual studio and deploy the reports again to reference the new assembly.

    ReplyDelete
  4. Hi,

    For a simple custom report opening them in VS rebuilding and redeploying worked. For a more complicated report like FreeTextInvoice this doesn't work. Have you managed to find a way to make these work?

    Also how did the exploration of other options go?

    ReplyDelete
  5. Thank you Iulian Cordobin.

    it helped me a lot.

    ReplyDelete
  6. Rebuilding and redeploying the report project in VS, when getting the aforementioned error while upgrading from Ax2012 R2->R3 worked! Thank you all for the helpful comments.

    ReplyDelete