XML parsing errors when manually converting app from Xamarin to Maui

Willie 31 Reputation points
2022-05-29T16:06:12.627+00:00

I am manually converting my Xamarin app to Maui. After fixing all the conversion errors, I am left with these 16 errors that I do not know how to resolve.

Severity Code Description Project File Line Suppression State
Error MAUIG1001 An error occured while parsing Xaml: Root element is missing.. xxxxxxx (net6.0-android) 1 Active
Error MAUIG1001 An error occured while parsing Xaml: Root element is missing.. xxxxxxx (net6.0-android) 1 Active
Error MAUIG1001 An error occured while parsing Xaml: Root element is missing.. xxxxxxx (net6.0-ios) 1 Active
Error MAUIG1001 An error occured while parsing Xaml: Root element is missing.. xxxxxxx (net6.0-ios) 1 Active
Error MAUIG1001 An error occured while parsing Xaml: Root element is missing.. xxxxxxx (net6.0-maccatalyst) 1 Active
Error MAUIG1001 An error occured while parsing Xaml: Root element is missing.. xxxxxxx (net6.0-maccatalyst) 1 Active
Error MAUIG1001 An error occured while parsing Xaml: Root element is missing.. xxxxxxx (net6.0-windows10.0.19041.0) 1 Active
Error MAUIG1001 An error occured while parsing Xaml: Root element is missing.. xxxxxxx (net6.0-windows10.0.19041.0) 1 Active
Error MAUIG1001 An error occured while parsing Xaml: Root element is missing.. xxxxxxx C:\Users\druch\Documents\xxxxxxx\xxxxxxx\CSC 1
Error MAUIG1001 An error occured while parsing Xaml: Root element is missing.. xxxxxxx C:\Users\druch\Documents\xxxxxxx\xxxxxxx\CSC 1
Error MAUIG1001 An error occured while parsing Xaml: Root element is missing.. xxxxxxx C:\Users\druch\Documents\xxxxxxx\xxxxxxx\CSC 1
Error MAUIG1001 An error occured while parsing Xaml: Root element is missing.. xxxxxxx C:\Users\druch\Documents\xxxxxxx\xxxxxxx\CSC 1
Error MAUIG1001 An error occured while parsing Xaml: Root element is missing.. xxxxxxx C:\Users\druch\Documents\xxxxxxx\xxxxxxx\CSC 1
Error MAUIG1001 An error occured while parsing Xaml: Root element is missing.. xxxxxxx C:\Users\druch\Documents\xxxxxxx\xxxxxxx\CSC 1
Error MAUIG1001 An error occured while parsing Xaml: Root element is missing.. xxxxxxx C:\Users\druch\Documents\xxxxxxx\xxxxxxx\CSC 1
Error MAUIG1001 An error occured while parsing Xaml: Root element is missing.. xxxxxxx C:\Users\druch\Documents\xxxxxxx\xxxxxxx\CSC 1

I replaced the app name with xxxxxxx

Any help would be appreciated

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,861 questions
{count} votes

4 answers

Sort by: Most helpful
  1. Mario Mora 16 Reputation points
    2022-08-30T08:18:27.73+00:00

    Hi, I'm experiencing the same problem
    after including all the files from my old Forms projects to a newly created maui solution, cannot get rid of this error:

    235978-image.png

    1>CSC : error MAUIG1001: An error occured while parsing Xaml: Root element is missing..
    1>CSC : error MAUIG1001: An error occured while parsing Xaml: Root element is missing..

    Don't know what to do, I fixed everything from the refactorization but I cannot continue. I followed all the guides, I think I have it all as expected.
    Not any clue how to fix it, neither in the warnings nor in the output of the build

    my target framewoks in the csproj are like this

    	<TargetFrameworks>net6.0-android;net6.0-ios</TargetFrameworks>    
    
    1 person found this answer helpful.

  2. Mario Mora 16 Reputation points
    2022-11-11T15:01:22.787+00:00

    Hi, recently I found the reason of this error and could solve it

    It's exactly what it says, a xaml is wrong, the real problem was finding which file is wrong over 30 xaml files checking manually one by one!
    Finally it turns out that during the raw refactoring battle, a xaml file had the root node commented, that was all :(

    a lot of time could be saved if the error message included the offending file name

    1 person found this answer helpful.

  3. GKG4 Programmers 5 Reputation points
    2023-03-14T03:50:04.4533333+00:00

    As stated above, the issue in XAML file, but not the project file, but it could be into any of your XAML file.

    I had this UserLogin.xaml, and while editing I accidentally press 0 at the starting of the file.

    Had to manually check all the XAML files, and then found this issue.

    1 person found this answer helpful.

  4. Colten Shipe 6 Reputation points
    2022-10-05T15:25:10.987+00:00

    I am also having this same issue. Has any fix been discovered for this?