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

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Visual Studio project compile error - "failed unexpectedly", "Data at the root level is invalid"

(0) ShareShare
ReportReport
Posted on by

Hi all, I am hoping someone else has seen this and knows how to resolve it. I (successfully) upgraded (i.e. completed the data upgrade for in-place upgrade checklist) a customer environment from R2 cu7 to R3. Afterwards I installed the Visual Studio tools (along with Trace Parser, Business Connector, Office add-ins and RDS integration), so that I could recompile their customized SSRS reports and thus correct the old references to 6.2 assemblies. There were no errors during the install. Immediately afterwards, I tried to right-click compile on a DAX Model Projects report node in the AOT, and got the following error:

MSB4018: The "CompileModel" task failed unexpectedly.

Microsoft.VisualStudio.Modeling.ModelingException: Data at the root level is invalid. Line 1, position 1. ---> System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.

  at System.

Under the "Path" column is "\C:\Program Files (x86)\MSBuild\Microsoft\DynamicsTools\Microsoft.Dynamics.Framework.Design.Reporting.Modeling.targets", but I think this may be a red herring, as I can't see anything wrong with the file (and it has a modification date of 11/2/2013). Also I can compile other VS project nodes, including some that were modified under R2. I should note that the VS project node itself does not have a cus layer, though the design under the SSRS Reports node in the AOT does.

Similarly, if I right-click edit to open Visual Studio for one of the affected reports, Visual Studio throws up a modal error dialog with "Data at the root level is invalid. Line 1, position 1.", after which the project is clearly unusable (e.g. if you expand the project in Solution Explorer, it says "The project file was unloaded", and reloading it just errors out the same way). Editing one of the reports that will compile with MSBuild seems to work fine. I will also note that all of these reports worked fine, with the same Visual Studio install, while the instance was still running AX 2012 R2 cu7.

Any input as to what is going on here will be most welcome.

Thanks, and regards,

Martin Walker

*This post is locked for comments

I have the same question (0)
  • Martin Walker Profile Picture
    on at
    RE: R3 Visual Studio project compile error - "failed unexpectedly", "Data at the root level is invalid"

    There is an update to this: I still do not know why the compile fails, but if I delete the cus layer of the corresponding SSRS Report node in he AOT (i.e. the precision design), I can then successfully compile the Visual Studio Dynamics AX Model Project which was previously failing to build. In other words, by removing the customizations, I can once again build it, and open it successfully with Visual Studio 2010. So, it is not possible to start with the R2 version of the customized report, but instead the changes need to be redone starting with the standard R3 report. This is the path I am going down now, though I would still love to know why the upgraded R2 version would not compile.

  • Darsh Profile Picture
    615 on at
    RE: R3 Visual Studio project compile error - "failed unexpectedly", "Data at the root level is invalid"

    Hi Martin,

    I have same issue with the report VendTopXVendorsbyYTDPurchase. after AX upgrade to R3

    do you get any proper solution.

    i am searching for this issue from quite long time. can you please guide me to resolve this?

  • Martin Walker Profile Picture
    on at
    RE: R3 Visual Studio project compile error - "failed unexpectedly", "Data at the root level is invalid"

    If you mean did I ever find a more elegant solution than deleting and repeating the customization's design changes (i.e. deleting the current layer of the SSRS report node in the AOT), then no, I did not.

    That said, if all you are trying to do is re-deploy existing reports after an upgrade, and what's stopping you is the classic error "Could not load file or assembly 'Microsoft.Dynamics.Framework.Metadata.AX, Version=...", then a good approach is to export the SSRS report as an XPO, and edit the version numbers in a text editor before re-importing the XPO, as described in a couple of different blog posts, including this one community.dynamics.com/.../ssrs-reports-ax-2012-could-not-load-assembly-metadata-ax-version-6-0. Obviously the new version number for R3 would be 6.3, not 6.2. You can always export and examine an unmodified  report to see what the version string should be exactly.

    Good luck!

    Martin

  • Darsh Profile Picture
    615 on at
    RE: R3 Visual Studio project compile error - "failed unexpectedly", "Data at the root level is invalid"

    Thanks Martin.

    in my case that's not the issue, version number on the reports are proper. and i open it on Visual studio and verify the properties of dataset and redeploy.

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#2
NNaumenko Profile Picture

NNaumenko 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans