dotnet/diagnostics

Not working on Spesific versions

Trkrkrl opened this issue · 6 comments

Description

I have a .net console app (minimal app, nothing special, no specific configs or settings), and can't install this package,
because my app's .net version is specific net7.0-windows10.0.19041.0.
"-windows10.0.19041.0," part of it is necessary and doesn't matter if it is net8 or net6.
When I try to install I get this error
image

@dotnet/dotnet-diag

@Trkrkrl please provide repro steps so we can investigate further. Are you able to install dotnet-counters with dotnet tool install -g dotnet-counters per https://learn.microsoft.com/en-us/dotnet/core/diagnostics/dotnet-counters#install?

Are you trying to use dotnet-counters as a nuget package on your project? Like adding <PackageReference Name="dotnet-counters" Version="8.0.505301" /> to a csproj? If so, that's not supported. That's a global tool meant to be consumed as @tommcdon points out. Otherwise, where is the TFM with -windows10.0.19041.0 coming from? Those don't get used in tool installs as far as I know.

To reproduce this issue you can create a console app, and change its .net version to a specific version (from csproj file) net7.0-windows10.0.19041.0.
image

After that try adding dotnet-counters nuget from, "manage nuget packages section" . That's all.

I can install some other packages like these:
image

@Trkrkrl the dotnet diagnostic tools are meant as development-time CLI global tools. You can't reference global tool packages as nuget packages in your application.

In case you want to consume the data from an application, you might want to use either EventListener for in-process processing or use Microsoft.Diagnostics.NETcore.Client to target out of process data collection.

Closing this issue as building app code against dotnet-counters is not intended to be a supported scenario