private static IReadOnlyList GetPlatforms()

in src/Microsoft.VisualStudio.SlnGen/SlnProject.cs [370:403]


        private static IReadOnlyList<string> GetPlatforms(Project project, string projectFileExtension, bool isUsingMicrosoftNETSdk)
        {
            if (string.Equals(projectFileExtension, ".vcxproj"))
            {
                HashSet<string> items = new HashSet<string>(StringComparer.OrdinalIgnoreCase);

                foreach (ProjectItem item in project.GetItems("ProjectConfiguration"))
                {
                    string platform = item.GetMetadataValue("Platform");

                    if (!platform.IsNullOrWhiteSpace())
                    {
                        items.Add(platform);
                    }
                }

                if (items.Any())
                {
                    return items.ToList();
                }
            }

            if (isUsingMicrosoftNETSdk)
            {
                string value = project.GetPropertyValue("Platforms");

                if (!value.IsNullOrWhiteSpace())
                {
                    return value.SplitSemicolonDelimitedList().ToList();
                }
            }

            return project.GetPossiblePropertyValuesOrDefault("Platform", "Any CPU").ToList();
        }