Skip to content

Re-design how to get "type: platform" information in MSBuild #17

Closed

Description

@eerhardt

In order to tell if an application is 'portable' or not, we need to get whether a dependency is marked as "type: platform", and which dependency it is.

However, that information is not available in the project.lock.json file. See NuGet/Home#2695.

Once NuGet provides that info in the project.lock.json file, we should be able to remove the TODOs in our MSBuild Tasks that need this information.

Activity

  1. eerhardt commented on Sep 9, 2016

    @eerhardt
    MemberAuthor

    Instead of relying on NuGet's "type: platform", the new idea is to use an MSBuild property to signify which dependency is to be considered the "platform" dependency.

    There will be an MSBuild property we'll call MicrosoftNETCorePlatformPackage for now (named TBD). This property will have the name of the dependency to treat as the "platform" dependency. The .NET Core tools will look at this property when it needs to get the name of the "platform" dependency for use in determining what dependencies to trim out in portable apps.

    If a NuGet package wants to be considered a “platform” package, it can create a “build/TFM/MyPackageId.props” file in its nupkg that looks something like the following:

    <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    
      <PropertyGroup>
        <MicrosoftNETCorePlatformPackage>MyPackageId</MicrosoftNETCorePlatformPackage>
      </PropertyGroup>
    
    </Project>

    This way, users just need to reference the package, and it will automatically be used as the platform dependency.

    If a user wants to manually set which package should be the platform dependency, they can set this property directly in their project.

  2. added this to the milestone on Sep 19, 2016
  3. changed the title [-]Need to get "type: platform" information from the project.lock.json file[/-] [+]Re-design how to get "type: platform" information in MSBuild[/+] on Sep 19, 2016
  4. modified the milestones: 1.0 RC, on Sep 19, 2016
  5. added a commit that references this issue on Jun 5, 2020
  6. added a commit that references this issue on Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions