1
4
2
4
3
1
4
17
Performance Improvements in .NET 11 (devblogs.microsoft.com)
5
10
6
5
7
2
8
-5
submitted 2 months ago by nemeski@mander.xyz to c/dotnet@programming.dev
9
5
submitted 2 months ago by nemeski@mander.xyz to c/dotnet@programming.dev
10
6
submitted 2 months ago by nemeski@mander.xyz to c/dotnet@programming.dev
11
5
.NET 11 Preview 7 is now available! (devblogs.microsoft.com)
submitted 2 months ago by nemeski@mander.xyz to c/dotnet@programming.dev
12
3
submitted 2 months ago by nemeski@mander.xyz to c/dotnet@programming.dev
13
0
submitted 2 months ago by nemeski@mander.xyz to c/dotnet@programming.dev
14
4
submitted 2 months ago by nemeski@mander.xyz to c/dotnet@programming.dev
15
3
submitted 3 months ago by nemeski@mander.xyz to c/dotnet@programming.dev
16
5
.NET 11 Preview 6 is now available! (devblogs.microsoft.com)
submitted 3 months ago by nemeski@mander.xyz to c/dotnet@programming.dev
17
1
submitted 3 months ago by nemeski@mander.xyz to c/dotnet@programming.dev
18
5

When using Central Package Management (Directory.Packages.props holds package versions), package version declarations can remain after package references have been removed. The package versions are unused and misleading.

dotnet nuget why can be used to get a dependency tree across projects to answer how a package comes into the dependency tree. However, the extensive tree list result for a list of version declarations is not viable to simply determine what 'is in use' and what isn't.

I am sharing my Nushell snippet which answers the question of what is declared but not referenced:

# List Directory.Packages.props version declarations that are in no csproj
def "dotnet unused-dirpackprops" [] {
  let defs = open Directory.Packages.props | from xml | get content | where tag == ItemGroup | get content.attributes.Include | flatten | sort --ignore-case --natural
  let refs = ls **/*.csproj | get name | each { open | from xml | get content | select content | flatten | flatten | where tag == PackageReference | get attributes.Include } | flatten | uniq | sort --ignore-case --natural
  $defs | difference $refs
}
❯ dotnet unused-dirpackprops
╭───┬─────────────────────────────────────────╮
│ 0 │ coverlet.collector                      │
│ 1 │ System.Net.Http                         │
│ 2 │ System.ServiceProcess.ServiceController │
╰───┴─────────────────────────────────────────╯

Gaps: In this simple form, only covers the standard csproj package references. Package references included during build through other target or prop files are not covered (probably irrelevant for most users).

19
5
submitted 3 months ago by nemeski@mander.xyz to c/dotnet@programming.dev
20
3
submitted 3 months ago by nemeski@mander.xyz to c/dotnet@programming.dev
21
9
submitted 3 months ago by nemeski@mander.xyz to c/dotnet@programming.dev
22
1
23
2
.NET 11 Preview 5 is now available! (devblogs.microsoft.com)
submitted 4 months ago by nemeski@mander.xyz to c/dotnet@programming.dev
24
3
submitted 4 months ago by nemeski@mander.xyz to c/dotnet@programming.dev
25
9
submitted 4 months ago by nemeski@mander.xyz to c/dotnet@programming.dev
view more: next ›

.NET

1884 readers
4 users here now

Getting started

Useful resources

IDEs and code editors

Tools

Rules

Related communities

Wikipedia pages

founded 3 years ago
MODERATORS