Skip to content

"#r nuget ..." downloads unneeded packages #18231

@inosik

Description

@inosik

Repro steps

  1. Ctrl + N in Visual Studio and select F# script

  2. Add #r "nuget: ini-parser" to the file

    It's important to type this into the file instead of pasting from the clipboard.

  3. Observe C:\Users\...\.nuget\packages

Expected behavior

Only ini-parser directory should appear.

Actual behavior

The following directories appear:

  • in/1.0.0/
  • ini/1.0.7/
  • ini-parser/3.4.0/

Every package on nuget.org whose ID is a prefix of the desired package is downloaded.

Another example: I tried to use microsoft.powershell.5.1.referenceassemblies once. Here are the packages that got downloaded:

Image

I have a bunch of packages in my NuGet cache directory that I never used (knowingly), but whose IDs are all prefixes of packages I did use:

This also looks like this is the reason why it takes so long for IntelliSense to work for the package I try to use.

Related information

Provide any related information (optional):

  • Operating system: Windows 11 23H2
  • Editing Tools: VS 17.12.3

Metadata

Metadata

Assignees

Labels

Area-VS-FSIVS window and commands for F# InteractiveBugImpact-High(Internal MS Team use only) Describes an issue with extreme impact on existing code.

Type

Projects

Status

New

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions