-
Notifications
You must be signed in to change notification settings - Fork 86
Description
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:
slngen/src/Microsoft.VisualStudio.SlnGen/SlnFile.cs
Lines 542 to 563 in f99e2e9
| 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"
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.
