Skip to content

Commit

Permalink
[XC] disable AOT warning on InitComp (#25276)
Browse files Browse the repository at this point in the history
- fixes #25199
  • Loading branch information
StephaneDelcroix authored Oct 15, 2024
1 parent 008c6af commit 7f463e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Controls/src/SourceGen/CodeBehindGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,6 @@ static void GenerateXamlCodeBehind(XamlProjectItem? xamlItem, Compilation compil
sb.AppendLine("\t\t{");
sb.AppendLine("#pragma warning disable IL2026, IL3050 // The body of InitializeComponent will be replaced by XamlC so LoadFromXaml will never be called in production builds");
sb.AppendLine($"\t\t\tglobal::Microsoft.Maui.Controls.Xaml.Extensions.LoadFromXaml(this, typeof({rootType}));");
sb.AppendLine("#pragma warning restore IL2026, IL3050");

if (namedFields != null)
{
Expand All @@ -369,6 +368,7 @@ static void GenerateXamlCodeBehind(XamlProjectItem? xamlItem, Compilation compil
sb.AppendLine($"\t\t\t{EscapeIdentifier(fname)} = global::Microsoft.Maui.Controls.NameScopeExtensions.FindByName<{ftype}>(this, \"{fname}\");");
}
}
sb.AppendLine("#pragma warning restore IL2026, IL3050");

sb.AppendLine("\t\t}");
sb.AppendLine("\t}");
Expand Down

0 comments on commit 7f463e3

Please sign in to comment.