diff --git a/src/Controls/samples/Directory.Build.props b/src/Controls/samples/Directory.Build.props index 70564c58672c..241a359433ad 100644 --- a/src/Controls/samples/Directory.Build.props +++ b/src/Controls/samples/Directory.Build.props @@ -2,6 +2,7 @@ true true + $(WarningsNotAsErrors);XC10101;XC10102 - \ No newline at end of file + diff --git a/src/Controls/src/Build.Tasks/SetPropertiesVisitor.cs b/src/Controls/src/Build.Tasks/SetPropertiesVisitor.cs index 0db5f2c6a11a..f70f7e42f694 100644 --- a/src/Controls/src/Build.Tasks/SetPropertiesVisitor.cs +++ b/src/Controls/src/Build.Tasks/SetPropertiesVisitor.cs @@ -397,7 +397,10 @@ static IEnumerable CompileBindingPath(ElementNode node, ILContext c if (dataTypeNode is ElementNode enode && enode.XmlType.NamespaceUri == XamlParser.X2009Uri && enode.XmlType.Name == nameof(Microsoft.Maui.Controls.Xaml.NullExtension)) + { + context.LoggingHelper.LogWarningOrError(10102, context.XamlFilePath, node.LineNumber, node.LinePosition, 0, 0, $"Binding could be compiled if x:DataType is not explicitly null", null); yield break; + } string dataType = null; diff --git a/src/Controls/tests/Xaml.UnitTests/Controls.Xaml.UnitTests.csproj b/src/Controls/tests/Xaml.UnitTests/Controls.Xaml.UnitTests.csproj index c28d6b2ff0ff..d958099c7f7c 100644 --- a/src/Controls/tests/Xaml.UnitTests/Controls.Xaml.UnitTests.csproj +++ b/src/Controls/tests/Xaml.UnitTests/Controls.Xaml.UnitTests.csproj @@ -5,8 +5,8 @@ Microsoft.Maui.Controls.Xaml.UnitTests Microsoft.Maui.Controls.Xaml.UnitTests 4 - 0672;0219;0414;CS0436;CS0618 - XC0618;XC10101 + $(NoWarn);0672;0219;0414;CS0436;CS0618 + $(WarningsNotAsErrors);XC0618;XC10101;XC10102 false true diff --git a/src/Essentials/samples/Directory.Build.props b/src/Essentials/samples/Directory.Build.props index 70564c58672c..241a359433ad 100644 --- a/src/Essentials/samples/Directory.Build.props +++ b/src/Essentials/samples/Directory.Build.props @@ -2,6 +2,7 @@ true true + $(WarningsNotAsErrors);XC10101;XC10102 - \ No newline at end of file + diff --git a/src/TestUtils/src/DeviceTests.Runners/TestUtils.DeviceTests.Runners.csproj b/src/TestUtils/src/DeviceTests.Runners/TestUtils.DeviceTests.Runners.csproj index 546b378eff74..ffdcea8bc68c 100644 --- a/src/TestUtils/src/DeviceTests.Runners/TestUtils.DeviceTests.Runners.csproj +++ b/src/TestUtils/src/DeviceTests.Runners/TestUtils.DeviceTests.Runners.csproj @@ -7,7 +7,7 @@ Microsoft.Maui.TestUtils.DeviceTests.Runners $(NoWarn);CA1416 - XC10101 + $(WarningsNotAsErrors);XC10101;XC10102