Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ivanbasov opened this issue Aug 8, 2019 · 8 comments
Labels
For consideration Used for items on the backlog to raise them to the top of that list for discussion Partner request requests from partners
Milestone

Comments

@ivanbasov
Copy link

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.

@ivanbasov
Copy link
Author

@nguerrera and @livarcocc please help with scheduling.

@msftgits msftgits transferred this issue from dotnet/cli Jan 31, 2020
@msftgits msftgits added this to the Backlog milestone Jan 31, 2020
@vatsalyaagrawal
Copy link

@rainersigwald please help with scheduling.

@JoeRobich
Copy link
Member

JoeRobich commented Mar 20, 2020

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.

@marcpopMSFT marcpopMSFT added For consideration Used for items on the backlog to raise them to the top of that list for discussion Partner request requests from partners labels Apr 8, 2020
@davkean
Copy link
Member

davkean commented Apr 28, 2020

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
Copy link

mjsabby commented May 24, 2020

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
Copy link
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
Copy link
Contributor

stan-sz commented Dec 20, 2022

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

@marcpopMSFT
Copy link
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
Labels
For consideration Used for items on the backlog to raise them to the top of that list for discussion Partner request requests from partners
Projects
None yet
Development

No branches or pull requests

8 participants