diff --git a/src/Controls/src/Build.Tasks/XamlCTask.cs b/src/Controls/src/Build.Tasks/XamlCTask.cs
index a7b7ee46f745..cb41e4bcf08f 100644
--- a/src/Controls/src/Build.Tasks/XamlCTask.cs
+++ b/src/Controls/src/Build.Tasks/XamlCTask.cs
@@ -37,7 +37,7 @@ public static void SetContext(this TaskLoggingHelper loggingHelper, int warningL
Context.WarningLevel = warningLevel;
Context.TreatWarningsAsErrors = treatWarningsAsErrors;
- Context.NoWarn = noWarn?.Split([';'], StringSplitOptions.RemoveEmptyEntries).Select(s =>
+ Context.NoWarn = noWarn?.Split([';', ','], StringSplitOptions.RemoveEmptyEntries).Select(s =>
{
if (int.TryParse(s, out var i))
return i;
@@ -50,7 +50,7 @@ public static void SetContext(this TaskLoggingHelper loggingHelper, int warningL
return -1;
}).Where(i => i != -1).ToList();
- Context.WarningsAsErrors = warningsAsErrors?.Split([';'], StringSplitOptions.RemoveEmptyEntries).Select(s =>
+ Context.WarningsAsErrors = warningsAsErrors?.Split([';', ','], StringSplitOptions.RemoveEmptyEntries).Select(s =>
{
if (int.TryParse(s, out var i))
return i;
@@ -63,7 +63,7 @@ public static void SetContext(this TaskLoggingHelper loggingHelper, int warningL
return -1;
}).Where(i => i != -1).ToList();
- Context.WarningsNotAsErrors = warningsNotAsErrors?.Split([';'], StringSplitOptions.RemoveEmptyEntries).Select(s =>
+ Context.WarningsNotAsErrors = warningsNotAsErrors?.Split([';', ','], StringSplitOptions.RemoveEmptyEntries).Select(s =>
{
if (int.TryParse(s, out var i))
return i;
diff --git a/src/Controls/tests/Xaml.UnitTests/Controls.Xaml.UnitTests.csproj b/src/Controls/tests/Xaml.UnitTests/Controls.Xaml.UnitTests.csproj
index e988431827da..25ecb0df6dac 100644
--- a/src/Controls/tests/Xaml.UnitTests/Controls.Xaml.UnitTests.csproj
+++ b/src/Controls/tests/Xaml.UnitTests/Controls.Xaml.UnitTests.csproj
@@ -6,7 +6,7 @@
Microsoft.Maui.Controls.Xaml.UnitTests
4
$(NoWarn);0672;0219;0414;CS0436;CS0618
- $(WarningsNotAsErrors);XC0618;XC0022;XC0023
+ $(WarningsNotAsErrors);XC0618;XC0022,XC0023
false
true