Skip to content

ARM/ARM64 not supported as values to --platform flag #437

@michael-hawker

Description

@michael-hawker

We need to build for ARM/ARM64 as platforms (as well as potentially other platforms names for different Android, iOS, etc... project types).

However, it appears that the list of values passed into the --platforms argument of the slngen tool is first scrubbed, and anything beyond x86, x64, any cpu is effectively scrubbed:

private IEnumerable<string> GetValidSolutionPlatforms(IEnumerable<string> platforms)
{
List<string> values = platforms
.Select(i => i.ToSolutionPlatform())
.Select(platform =>
{
return platform.ToLowerInvariant() switch
{
"any cpu" => platform,
"x64" => platform,
"x86" => platform,
"amd64" => "x64",
"win32" => "x86",
_ => null
};
})
.Where(i => i != null)
.OrderBy(i => i)
.ToList();
return values.Any() ? values : new List<string> { "Any CPU" };
}


I assume this function is used by the slngen tool in addition to the msbuild target mode, as that's the behavior I'm seeing on the command line:

dotnet slngen --platform "ARM64"

image


This is a blocking issue for us adopting this tool in our workflow, everything else currently appears to be working fine.

The simplest solution would allow custom values by not making everything falling out of the switch statement go to null but instead pass through the original platform value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions