Getting weird compiler error XAGAP7000 in my otherwise-simple C#/MAUI app

I have a simple C#/MAUI app – all classes in the same namespace. Getting this weird error XAGAP7000 all of a sudden, and Googling doesn’t seem to help. I tried repairing the Visual Studio installation as well. Double-checked the XAML (see below). Totally flummoxed!

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>Severity Code Description Project File Line Suppression State
Error (active) XAGAP7000 System.Xml.XmlException: The ':' character, hexadecimal value 0x3A, cannot be included in a name. Line 2, position 26.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.ParseAttributes()
at System.Xml.XmlTextReaderImpl.ParseElement()
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlReader.MoveToContent()
at Xamarin.Android.Tasks.GetAndroidPackageName.RunTask()
at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 25 Calculator2 (net8.0-android) C:Program FilesdotnetpacksMicrosoft.Android.Sdk.Windows34.0.95toolsXamarin.Android.Common.targets 618
</code>
<code>Severity Code Description Project File Line Suppression State Error (active) XAGAP7000 System.Xml.XmlException: The ':' character, hexadecimal value 0x3A, cannot be included in a name. Line 2, position 26. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.ParseAttributes() at System.Xml.XmlTextReaderImpl.ParseElement() at System.Xml.XmlTextReaderImpl.ParseDocumentContent() at System.Xml.XmlReader.MoveToContent() at Xamarin.Android.Tasks.GetAndroidPackageName.RunTask() at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 25 Calculator2 (net8.0-android) C:Program FilesdotnetpacksMicrosoft.Android.Sdk.Windows34.0.95toolsXamarin.Android.Common.targets 618 </code>
Severity    Code    Description Project File    Line    Suppression State
Error (active)  XAGAP7000   System.Xml.XmlException: The ':' character, hexadecimal value 0x3A, cannot be included in a name. Line 2, position 26.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.ParseAttributes()
   at System.Xml.XmlTextReaderImpl.ParseElement()
   at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
   at System.Xml.XmlReader.MoveToContent()
   at Xamarin.Android.Tasks.GetAndroidPackageName.RunTask()
   at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 25 Calculator2 (net8.0-android)    C:Program FilesdotnetpacksMicrosoft.Android.Sdk.Windows34.0.95toolsXamarin.Android.Common.targets    618 

But when you double-click on this error, it takes you to the first line of the snippet below in Xamarin.Android.Common.targets, where there’s no ‘:’ at all:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code> <GetAndroidPackageName
ManifestFile="$(_AndroidManifestAbs)"
AssemblyName="$(AssemblyName)"
ManifestPlaceholders="$(AndroidManifestPlaceholders)"
PackageName="$(_AndroidPackage)">
<Output TaskParameter="PackageName" PropertyName="_AndroidPackage" />
</GetAndroidPackageName>
</Target>
</code>
<code> <GetAndroidPackageName ManifestFile="$(_AndroidManifestAbs)" AssemblyName="$(AssemblyName)" ManifestPlaceholders="$(AndroidManifestPlaceholders)" PackageName="$(_AndroidPackage)"> <Output TaskParameter="PackageName" PropertyName="_AndroidPackage" /> </GetAndroidPackageName> </Target> </code>
  <GetAndroidPackageName
      ManifestFile="$(_AndroidManifestAbs)"
      AssemblyName="$(AssemblyName)"
      ManifestPlaceholders="$(AndroidManifestPlaceholders)"
      PackageName="$(_AndroidPackage)">
    <Output TaskParameter="PackageName" PropertyName="_AndroidPackage" />
  </GetAndroidPackageName>
</Target>

Here’s the top of my XAML:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code><ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Adam"
x:Class="Adam.MainPage"
BackgroundColor="Black">
<ContentPage.BindingContext>
<local:AdamViewModel />
</ContentPage.BindingContext>
</code>
<code><ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:Adam" x:Class="Adam.MainPage" BackgroundColor="Black"> <ContentPage.BindingContext> <local:AdamViewModel /> </ContentPage.BindingContext> </code>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:Adam"
             x:Class="Adam.MainPage"
             BackgroundColor="Black">
    
    <ContentPage.BindingContext>
        <local:AdamViewModel />
    </ContentPage.BindingContext>

Other than that, I’m styling my custom buttons:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code> <Style TargetType="{x:Type local:Button2}">
</code>
<code> <Style TargetType="{x:Type local:Button2}"> </code>
   <Style TargetType="{x:Type local:Button2}">

And doing some commanding:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code><local:Button2 (blah blah) Command="{Binding ButtonClick}" CommandParameter="A0" />
</code>
<code><local:Button2 (blah blah) Command="{Binding ButtonClick}" CommandParameter="A0" /> </code>
<local:Button2 (blah blah) Command="{Binding ButtonClick}" CommandParameter="A0" />

And that bound function is sitting in my ViewModel class.

Appreciate any thoughts on why Visual Studio 2022 hates me today.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật