Skip to content

Provide a map file generation to use for remove unused references functionality #10414

Open
@ivanbasov

Description

@ivanbasov

This task is a part of dotnet/roslyn#6763

The build team will generate a file with a map of assemblies, packages which can be checked for usage/non-usage. MS Build will generated the file. If other environments are used, they have to provide this file on their own.

Activity

ivanbasov

ivanbasov commented on Aug 8, 2019

@ivanbasov
Author

@nguerrera and @livarcocc please help with scheduling.

transferred this issue fromdotnet/clion Jan 31, 2020
added this to the Backlog milestone on Jan 31, 2020
vatsalyaagrawal

vatsalyaagrawal commented on Mar 11, 2020

@vatsalyaagrawal

@rainersigwald please help with scheduling.

JoeRobich

JoeRobich commented on Mar 20, 2020

@JoeRobich
Member

A proposal for what the mapping could look like.

<Build ProjectPath="">
  <Projects>
    <Project Path="" IsRuntimeRequired="">
      <References>
        <ProjectReference Path="" />
        <PackageReference Name="" Version="" />
        <SdkReference Name="" />
        <FrameworkReference Name="" Version="" />
        <AssemblyReference AssemblyName="" />
      </References>
    </Project>
  </Projects>
  <Packages>
    <Package Name="" Version="" IsRuntimeRequired="">
      <References>
        <PackageReference Name="" Version="" />
        <AssemblyReference AssemblyName="" />
      </References>
  </Packages>
  <Sdks>
    <Sdk Name="" IsRuntimeRequired="">
      <References>
        <AssemblyReference AssemblyName="" />
      </References>
  </Sdks>
  <Frameworks>
    <Framework Name="" Version="" IsRuntimeRequired="">
      <References>
        <AssemblyReference AssemblyName="" />
      </References>
    </Framework>
  </Frameworks>
  <Assemblies>
    <Assembly AssemblyName="" Path="" IsRuntimeRequired="" />
  </Assemblies>
</Build>

Updated to include IsRuntimeRequired property which is used to indicate a reference is knowingly unused at compile time but necessary at runtime.

added
For considerationUsed for items on the backlog to raise them to the top of that list for discussion
on Apr 8, 2020
davkean

davkean commented on Apr 28, 2020

@davkean
Member

When we discussed this last time, this was going to be some metadata on the resulting resolved reference that pointed back to the original item spec + original item type. We would use the same data for when you copied a reference from one project to another or used a code fix to install a reference from another project.

mjsabby

mjsabby commented on May 24, 2020

@mjsabby

Will this file contain assembyrefs that were walked as part of compilation but never ended up in the output assembly? So for example an assembly that only has type forwards?

marcpopMSFT

marcpopMSFT commented on Nov 23, 2020

@marcpopMSFT
Member

Update: There is an effort to see if the data needed for this can be pulled from the project.assets.json file so a map may not be needed from the SDK. We'll keep an eye on that and update this issue if that ends up being the case.

stan-sz

stan-sz commented on Dec 20, 2022

@stan-sz
Contributor

@marcpopMSFT - do you have any update for the effort?

marcpopMSFT

marcpopMSFT commented on Jan 3, 2023

@marcpopMSFT
Member

Adding @JonDouglas and @aortiz-msft to see if they recall if any effort on the nuget side for this made progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    For considerationUsed for items on the backlog to raise them to the top of that list for discussionPartner requestrequests from partners

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Provide a map file generation to use for remove unused references functionality · Issue #10414 · dotnet/sdk