diff --git a/src/MSBuild.Abstractions/ProjectItemHelpers.cs b/src/MSBuild.Abstractions/ProjectItemHelpers.cs index 65806e393..c6ddda04c 100644 --- a/src/MSBuild.Abstractions/ProjectItemHelpers.cs +++ b/src/MSBuild.Abstractions/ProjectItemHelpers.cs @@ -127,8 +127,8 @@ public static bool IsReferencingSystemWeb(ProjectItemElement item) => public static bool IsReferencingSettingsSingleFileGenerator(ProjectItemElement item) { - var metadata = item.Children.FirstOrDefault(child => "Generator".Equals(child.ElementName, StringComparison.Ordinal) ) as ProjectMetadataElement; - return metadata is null ? false : metadata.Value.Equals("SettingsSingleFileGenerator", StringComparison.Ordinal); + var metadata = item.Children.FirstOrDefault(child => MSBuildFacts.EmbeddedResourceGeneratorProperty.Equals(child.ElementName, StringComparison.Ordinal) ) as ProjectMetadataElement; + return metadata is null ? false : metadata.Value.Equals(MSBuildFacts.SettingsSingleFileGenerator, StringComparison.Ordinal); } } diff --git a/src/MSBuild.Conversion.Facts/MSBuildFacts.cs b/src/MSBuild.Conversion.Facts/MSBuildFacts.cs index e02074a22..1887487a6 100644 --- a/src/MSBuild.Conversion.Facts/MSBuildFacts.cs +++ b/src/MSBuild.Conversion.Facts/MSBuildFacts.cs @@ -298,5 +298,7 @@ public static class MSBuildFacts public const string Net5 = "net5.0"; public const string Net5Windows = "net5.0-windows"; public const string AppConfig = "App.config"; + public const string EmbeddedResourceGeneratorProperty = "Generator"; + public const string SettingsSingleFileGenerator = "SettingsSingleFileGenerator"; } }