diff --git a/src/Controls/src/Build.Tasks/SetPropertiesVisitor.cs b/src/Controls/src/Build.Tasks/SetPropertiesVisitor.cs index a3dba7c11c68..0db5f2c6a11a 100644 --- a/src/Controls/src/Build.Tasks/SetPropertiesVisitor.cs +++ b/src/Controls/src/Build.Tasks/SetPropertiesVisitor.cs @@ -389,8 +389,10 @@ static IEnumerable CompileBindingPath(ElementNode node, ILContext c n = n.Parent as IElementNode; } - if (dataTypeNode is null) + if (dataTypeNode is null) { + context.LoggingHelper.LogWarningOrError(10101, context.XamlFilePath, node.LineNumber, node.LinePosition, 0, 0, $"Binding could be compiled if x:DataType is specified", null); yield break; + } if (dataTypeNode is ElementNode enode && enode.XmlType.NamespaceUri == XamlParser.X2009Uri diff --git a/src/Controls/tests/Xaml.UnitTests/Controls.Xaml.UnitTests.csproj b/src/Controls/tests/Xaml.UnitTests/Controls.Xaml.UnitTests.csproj index cc244dbf002b..c28d6b2ff0ff 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 0672;0219;0414;CS0436;CS0618 - XC0618 + XC0618;XC10101 false true diff --git a/src/TestUtils/src/DeviceTests.Runners/TestUtils.DeviceTests.Runners.csproj b/src/TestUtils/src/DeviceTests.Runners/TestUtils.DeviceTests.Runners.csproj index e20ff19881d1..546b378eff74 100644 --- a/src/TestUtils/src/DeviceTests.Runners/TestUtils.DeviceTests.Runners.csproj +++ b/src/TestUtils/src/DeviceTests.Runners/TestUtils.DeviceTests.Runners.csproj @@ -6,7 +6,8 @@ Microsoft.Maui.TestUtils.DeviceTests.Runners Microsoft.Maui.TestUtils.DeviceTests.Runners - $(NoWarn),CA1416 + $(NoWarn);CA1416 + XC10101