Skip to content

The 'platforms' key is not recognized as a child of packs in WorkloadManifest.json #17151

Closed

Description

@pjcollins

I'm attempting use the platforms key specified in the workload-manifest spec:

"Microsoft.iOS.Windows.Sdk": {
	"kind": "sdk",
	"version": "14.5.100-ci.pr.gh11251.654",
	"platforms": [ "win-x86", "win-x64" ]
}

However this entry does not seem to be recognized when declared directly on a pack:

 /Users/peter/source/net6-samples/HelloiOS/HelloiOS.csproj : warning MSB4242: The SDK resolver "Microsoft.DotNet.MSBuildWorkloadSdkResolver" failed to run. Unknown key 'platforms' at offset 443
 /usr/local/share/dotnet/sdk/6.0.100-preview.4.21218.6/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.props(14,3): warning MSB4242: The SDK resolver "Microsoft.DotNet.MSBuildWorkloadSdkResolver" failed to run. Unknown key 'platforms' at offset 443
 /usr/local/share/dotnet/sdk/6.0.100-preview.4.21218.6/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.ILLink.props(14,3): warning MSB4242: The SDK resolver "Microsoft.DotNet.MSBuildWorkloadSdkResolver" failed to run. Unknown key 'platforms' at offset 443
 /usr/local/share/dotnet/sdk/6.0.100-preview.4.21218.6/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(16,3): warning MSB4242: The SDK resolver "Microsoft.DotNet.MSBuildWorkloadSdkResolver" failed to run. Unknown key 'platforms' at offset 443

Edit: Is this something that should be supported at an individual pack level? Or should it only work when declared at the workload level?

Activity

  1. ghost added
    untriaged
    on Apr 23, 2021
  2. changed the title [-]The 'platforms' key is not recognized in WorkloadManifest.json[/-] [+]The 'platforms' key is not recognized as a child of packs in WorkloadManifest.json[/+] on Apr 23, 2021
  3. wli3 commented on Apr 25, 2021

    @wli3
  4. mhutch commented on Apr 26, 2021

    @mhutch
    Contributor

    Per the spec, it's currently only supported at the workload level. We can consider adding it on the pack level as a convenience, which would propagate up to any workloads that included it, just like workloads that extend a platform-restricted workload inherit the restrictions.

    I would generally expect most packs to only ever be included directly in one workload, but included transitively in other workloads via the extends workload mechanism. There's also the abstract workload mechanism - for example, you could create a ios-windows-sdk abstract workload that just contains this pack and is platform-restricted, and concrete workloads could extend that instead of including the pack directly.

    That said, I'm not sure this is what you want. The platform key will prevent installing the workload on unsupported platforms. If you want the IOS workload to be installable on both Mac and Windows but to only include this pack when installing on Windows, you should:

    • use platform to restrict the workload to Mac and Windows
    • for the Windows-only pack, use an alias pack that only contains aliases for Windows
  5. wli3 commented on May 5, 2021

    @wli3

    @pjcollins does that satisfy your question?

  6. added this to the 6.0.1xx milestone on May 5, 2021
  7. removed
    untriaged
    on May 5, 2021
  8. wli3 commented on May 12, 2021

    @wli3
  9. pjcollins commented on May 12, 2021

    @pjcollins
    MemberAuthor

    Sorry for the delay, thanks for the breakdown @mhutch. I don't see a need on our end to have platforms supported at the pack level, the suggested alternatives should work fine for us.

  10. added theissue type on Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions